Skip to content

Commit

Permalink
Modify structure
Browse files Browse the repository at this point in the history
  • Loading branch information
geraked committed Aug 17, 2021
1 parent b25945f commit ffeb829
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 126 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ jobs:
rm -r dist -ErrorAction Ignore;
rm -r build -ErrorAction Ignore;
rm *.spec -ErrorAction Ignore;
rm ../version.txt -ErrorAction Ignore;
../.env/Scripts/activate;
pyinstaller --noconfirm --clean --onefile --name 'mdpdfbook' __main__.py;
create-version-file ../metadata.yml --outfile ../version.txt;
pyinstaller --noconfirm --clean --onefile --icon ../favicon.ico --version-file ../version.txt --name 'mdpdfbook' __main__.py;
rm -r build -ErrorAction Ignore;
rm *.spec -ErrorAction Ignore
rm *.spec -ErrorAction Ignore;
rm ../version.txt -ErrorAction Ignore
- name: Create Release
id: create_release
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
{
"label": "Build",
"type": "shell",
"command": "rm -r dist; rm -r build; rm *.spec; cls; ../.env/Scripts/activate; pyinstaller --noconfirm --clean --onefile --name 'mdpdfbook' __main__.py; rm -r build; rm *.spec",
"command": "rm -r dist; rm -r build; rm *.spec; rm ../version.txt; cls; ../.env/Scripts/activate; create-version-file ../metadata.yml --outfile ../version.txt; pyinstaller --noconfirm --clean --onefile --icon ../favicon.ico --version-file ../version.txt --name 'mdpdfbook' __main__.py; rm -r build; rm *.spec; rm ../version.txt",
"options": {
"cwd": "mdpdfbook"
},
Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Convert MD to PDF
![catalog](catalog.jpg)

# mdpdfbook

![GitHub release (latest by date)](https://img.shields.io/github/v/release/geraked/mdpdfbook)
[![CI](https://github.com/geraked/mdpdfbook/actions/workflows/main.yml/badge.svg)](https://github.com/geraked/crack-qv/actions/workflows/main.yml)

This is a toolkit that generates pdf books from multiple `*.md` files or [mdBook](https://github.com/rust-lang/mdBook) based structure.

### How To Use?

- Download `mdpdfbook.exe` from the `Releases` section.
- Run the toolkit and Enter the directory path containing `SUMMARY.md` or other `*.md` files.
- Press `Enter` to start operation.
- The output file with the name `mdpdfbook-output.pdf` will be generated in the same directory.

If you want to generate pdf books from [mdBook](https://github.com/rust-lang/mdBook) based structure, You must enter the directory path containing the `SUMMARY.md` file in the root, otherwise enter the directory path containing multiple `*.md` files. No matter whether the markdown files are in the root or sub-folders, it merges all of them in order.

## Author

**Rabist** - view on [LinkedIn](https://www.linkedin.com/in/rabist)

## License

Licensed under [MIT](LICENSE).
Licensed under [MIT](LICENSE).
Binary file added catalog.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added favicon.ico
Binary file not shown.
5 changes: 2 additions & 3 deletions mdpdfbook/__main__.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
from os import path, system
import os
import req
from os import path, system

import convert


def main():
req.main()
folder = input(
'Enter the directory path containing SUMMARY.md or other *.md files:\n')
try:
Expand Down
5 changes: 3 additions & 2 deletions mdpdfbook/convert.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import sys
import re
import shutil
from os import path, walk, remove
import sys
from os import path, remove, walk

from mdpdf.converter import Converter
from mdpdf.headfoot import Header

Expand Down
52 changes: 0 additions & 52 deletions mdpdfbook/rcdec.py

This file was deleted.

60 changes: 0 additions & 60 deletions mdpdfbook/req.py

This file was deleted.

7 changes: 7 additions & 0 deletions metadata.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Version: 1.0.1
CompanyName: Geraked
FileDescription: Generate PDF Book From Markdowns
InternalName: Mdpdfbook
LegalCopyright: © 2021 Geraked
OriginalFilename: mdpdfbook.exe
ProductName: Mdpdfbook
6 changes: 2 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
mdpdf
requests
pycryptodome
pypiwin32
pyinstaller
pyinstaller
pyinstaller-versionfile

0 comments on commit ffeb829

Please sign in to comment.