1.0.43 • Published 9 months ago

@mp5maker/camfsp v1.0.43

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Combine all markdowns in a folder to a single pdf (camfsp)

This will combine all the markdown in a specific folder to a single PDF

  • Just mention the folder, it will recursively select all the markdowns file with (.md) extension only
  • Node.js (ESM and CommonJS) - 18.x, 19.x, 20.x

How to use

npx @mp5maker/camfsp convert --input [folder-src] --output [file-name]

!CAUTION Sometimes npx do not have the share module

  • Windows
    • For windows machine, use git-bash or similar
  • Linux

!TIP Please use the installation process instead, if direct npx do not work

!CAUTION Try to avoid node_modules folder

Installation

npm install @mp5maker/camfsp

Add it to the scripts (package.json)

"generate": "npx @mp5maker/camfsp convert --input [folder-src] --output [file-name]"
  • It can be any script name (up to you)

Run the script

npm run generate

Example: Convert

  • Available Options:

    • input (Required): Folder name
    • output (Required): File name (".pdf")
    • extension (Optional): pdf option will combine all pdfs to one pdf
  • If your terminal is in root folder

npx @mp5maker/camfsp convert --input src --output documents.pdf
└── root/
    ├── index.tsx
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx
    └── src/
        ├── index.tsx
        ├── hello.md
        ├── doe.md
        ├── nested-folder/
        │   ├── nice.md
        │   ├── nice.tsx
        │   └── nice.py
        └── try-another-folder/
            ├── .gitkeep
            └── world.md

This collect the markdowns the way it is structured in vscode

  1. hello.md
  2. doe.md
  3. nice.md
  4. world.md

Example: Convert (Extension: PDF)

  • If your terminal is in root folder
npx @mp5maker/camfsp convert --input src --output documents.pdf --extension pdf
└── root/
    ├── index.tsx
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx
    └── src/
        ├── index.tsx
        ├── hello.pdf
        ├── doe.pdf
        ├── nested-folder/
        │   ├── nice.md
        │   ├── nice.tsx
        │   └── nice.py
        └── try-another-folder/
            ├── .gitkeep
            └── world.pdf

This collect the markdowns the way it is structured in vscode

  1. hello.pdf
  2. doe.pdf
  3. world.pdf

Example: Collect

  • Available Options:

    • input (Required): Folder name
    • output (Required): File name (".pdf")
    • pick (Optional): Specific extensions to extract eg: ".py" ".ts"
    • search (Optional): The term that you are searching for eg: "import os"
    • cut (Optional): Long file names to more readable ones
      • eg: "/User/johndoe/src/hello.md" to "/src/hello.md"
      • by --cut "/User/johndoe"
  • Pick (By Default):

    • ".jsx"
    • ".tsx"
    • ".html"
    • "scss"
    • ".css"
    • ".js"
    • ".ts"
  • If your terminal is in root folder
npx @mp5maker/camfsp collect --input src --output documents.pdf --search "<Select" --pick ".js" ".tsx" --cut "root/src"
└── root/
    ├── index.tsx ("<Select, in the code")
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx ("<Select, in the code")
    └── src/
        ├── index.tsx
        ├── hello.pdf
        ├── doe.pdf
        ├── nested-folder/
        │   ├── nice.md
        │   ├── nice.js ("<Select, in the code")
        │   └── nice.py
        └── try-another-folder/
            ├── .gitkeep
            └── world.pdf

This collect the markdowns the way it is structured in vscode

  1. index.tsx
  2. topSection.stories.tsx
  3. nice.js

Example: Summarize (Local AI)

This feature is only available if you have a local llm

  • This will collect all the markdown files and make a summary of it
  • Only supported from the models provided by Ollama
  • Available Options:

    • input (Required): Folder name
    • output (Required): File name (".pdf")
    • baseurl (Optional): by default, 'http://localhost:11434'
    • model (Optional): by default, 'llama3.1:latest'
    • quiz (Optional): by default, false
      • This will generate a quiz instead of summary
    • ask (Optional): by default, false
      • This will generate answers based on your question
    • Three modes (default, --ask, --quiz), cannot be combined
  • If your terminal is in root folder
npx @mp5maker/camfsp summarize --input src --output documents.pdf --baseurl "http://localhost:11434" --model "llama3.1:latest"

Example: Summarize (Local AI: Quiz)

This feature is only available if you have a local llm

  • This will collect all the markdown files and make a summary of it
  • Only supported from the models provided by Ollama
  • If your terminal is in root folder
npx @mp5maker/camfsp summarize --input src --output documents.pdf --baseurl "http://localhost:11434" --model "llama3.1:latest" --quiz

Example: Summarize (Local AI: Ask)

This feature is only available if you have a local llm

  • Check ollama list
  • If not present then pull it
ollama pull mxbai-embed-large
  • This will collect all the markdown files and make a summary of it
  • Only supported from the models provided by Ollama
  • If your terminal is in root folder
npx @mp5maker/camfsp summarize --input src --output documents.pdf --baseurl "http://localhost:11434" --model "llama3.1:latest" --ask "Tell me something interesting"

Recommendation (For organizing files)

  • Adding numbers with the markdown file name will organize the files better
└── root/
    ├── index.tsx
    ├── topSection.scss
    ├── topSection.test.tsx
    ├── topSection.stories.tsx
    └── src/
        ├── 01.hello.md
        ├── 02.doe.md
        ├── nested-folder/
        │   ├── 01-nice.md
        │   ├── 02-ok.md
        │   └── 03.more.md
        └── try-another-folder/
            ├── .gitkeep
            └── 01-world.md
1.0.43

9 months ago

1.0.42

9 months ago

1.0.41

9 months ago

1.0.40

9 months ago

1.0.39

9 months ago

1.0.38

9 months ago

1.0.37

9 months ago

1.0.36

9 months ago

1.0.35

9 months ago

1.0.34

10 months ago

1.0.33

10 months ago

1.0.32

10 months ago

1.0.31

10 months ago

1.0.30

10 months ago

1.0.29

10 months ago

1.0.28

10 months ago

1.0.27

10 months ago

1.0.26

10 months ago

1.0.25

10 months ago

1.0.24

10 months ago

1.0.22

10 months ago

1.0.21

10 months ago

1.0.20

10 months ago

1.0.19

10 months ago

1.0.18

10 months ago

1.0.17

10 months ago

1.0.16

10 months ago

1.0.15

10 months ago

1.0.14

10 months ago

1.0.13

10 months ago

1.0.12

10 months ago

1.0.11

10 months ago

1.0.10

10 months ago

1.0.9

10 months ago

1.0.8

10 months ago

1.0.7

10 months ago

1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago