code-down 2.0.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- code_down-2.0.1/PKG-INFO +148 -0
- code_down-2.0.1/README.md +120 -0
- code_down-2.0.1/pyproject.toml +58 -0
- code_down-2.0.1/setup.cfg +4 -0
- code_down-2.0.1/src/code_down.egg-info/PKG-INFO +148 -0
- code_down-2.0.1/src/code_down.egg-info/SOURCES.txt +24 -0
- code_down-2.0.1/src/code_down.egg-info/dependency_links.txt +1 -0
- code_down-2.0.1/src/code_down.egg-info/entry_points.txt +2 -0
- code_down-2.0.1/src/code_down.egg-info/requires.txt +14 -0
- code_down-2.0.1/src/code_down.egg-info/top_level.txt +1 -0
- code_down-2.0.1/src/codedown/__init__.py +0 -0
- code_down-2.0.1/src/codedown/__main__.py +41 -0
- code_down-2.0.1/src/codedown/assets/themes/base.css +132 -0
- code_down-2.0.1/src/codedown/assets/themes/dark.css +27 -0
- code_down-2.0.1/src/codedown/assets/themes/dark.toml +4 -0
- code_down-2.0.1/src/codedown/assets/themes/light.css +28 -0
- code_down-2.0.1/src/codedown/assets/themes/light.toml +4 -0
- code_down-2.0.1/src/codedown/cli.py +266 -0
- code_down-2.0.1/src/codedown/config.py +48 -0
- code_down-2.0.1/src/codedown/converter.py +36 -0
- code_down-2.0.1/src/codedown/paths.py +5 -0
- code_down-2.0.1/src/codedown/themes.py +67 -0
- code_down-2.0.1/src/codedown/updater.py +135 -0
- code_down-2.0.1/src/codedown/watcher.py +69 -0
- code_down-2.0.1/tests/test_argv_rewrite.py +54 -0
- code_down-2.0.1/tests/test_cli_commands.py +165 -0
code_down-2.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-down
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: A CLI tool that converts Markdown files into beautifully themed PDFs with syntax-highlighted code blocks.
|
|
5
|
+
Author-email: bouajila <bouajilamedyessine@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/bouajilaProg/CodeDown
|
|
7
|
+
Project-URL: Repository, https://github.com/bouajilaProg/CodeDown
|
|
8
|
+
Project-URL: Documentation, https://github.com/bouajilaProg/CodeDown#readme
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/bouajilaProg/CodeDown/issues
|
|
10
|
+
Keywords: cli,markdown,pdf,converter,documentation
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: markdown>=3.4
|
|
18
|
+
Requires-Dist: pygments>=2.15
|
|
19
|
+
Requires-Dist: weasyprint>=60.0
|
|
20
|
+
Requires-Dist: typer[all]>=0.12.0
|
|
21
|
+
Requires-Dist: click<9.0,>=8.1.7
|
|
22
|
+
Requires-Dist: InquirerPy>=0.3
|
|
23
|
+
Requires-Dist: watchdog>=3.0
|
|
24
|
+
Requires-Dist: requests>=2.28
|
|
25
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
28
|
+
|
|
29
|
+
# codeDown
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/code-down/)
|
|
32
|
+
[](https://pypi.org/project/code-down/)
|
|
33
|
+
[](https://github.com/bouajilaProg/CodeDown/blob/main/LICENSE)
|
|
34
|
+
[](https://github.com/bouajilaProg/CodeDown/actions/workflows/release.yml)
|
|
35
|
+
[](https://github.com/bouajilaProg/CodeDown/releases/latest)
|
|
36
|
+
|
|
37
|
+
**codeDown** is a simple yet powerful **CLI tool** that converts Markdown (`.md`) files into **beautiful themed PDFs** — complete with **syntax-highlighted code blocks**.
|
|
38
|
+
|
|
39
|
+
Built for developers who love clean documentation, readable code snippets, and automated workflows.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
* **Syntax Highlighting** for code blocks
|
|
46
|
+
* **Selectable Themes** – interactive picker or CLI flag (`light`, `dark`)
|
|
47
|
+
* **Watch Mode** – auto-regenerate PDF on file save
|
|
48
|
+
* **Self-Update** – update from the CLI (`code-down update`)
|
|
49
|
+
* **Configurable** – set a default theme via `code-down config set-theme`
|
|
50
|
+
* **Fast & Lightweight** – converts Markdown to PDF in seconds
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### Via pip
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install code-down
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Via binary (Linux)
|
|
63
|
+
|
|
64
|
+
1. **Download the latest release**
|
|
65
|
+
Visit the [Releases Page](https://github.com/bouajilaProg/CodeDown/releases) and download the latest Linux binary.
|
|
66
|
+
|
|
67
|
+
2. **Make it executable and move to PATH**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
chmod +x code-down
|
|
71
|
+
sudo mv code-down /usr/local/bin/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
Convert a Markdown file into a themed PDF:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
code-down input.md output.pdf -s dark
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Watch mode
|
|
85
|
+
|
|
86
|
+
Automatically rebuild the PDF when the Markdown file changes:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
code-down -w input.md
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Options
|
|
93
|
+
|
|
94
|
+
| Flag | Description | Default |
|
|
95
|
+
| ----------------- | --------------------------------------- | ----------------------------------- |
|
|
96
|
+
| `-o, --output` | Output PDF file path | Same as input with `.pdf` extension |
|
|
97
|
+
| `-s, --style` | Theme style (e.g. `light`, `dark`) | Config default or `dark` |
|
|
98
|
+
| `-w, --watch` | Watch file and rebuild PDF on changes | |
|
|
99
|
+
| `-v, --version` | Print version and exit | |
|
|
100
|
+
|
|
101
|
+
### Commands
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
| -------------------- | --------------------------------------------- |
|
|
105
|
+
| `code-down themes` | Pick a theme interactively (sets as default) |
|
|
106
|
+
| `code-down config show` | Show current configuration |
|
|
107
|
+
| `code-down config set-theme` | Set the default theme (interactive or by name) |
|
|
108
|
+
| `code-down update` | Update codeDown to the latest version |
|
|
109
|
+
|
|
110
|
+
### Examples
|
|
111
|
+
|
|
112
|
+
Quick test file:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
code-down examples/example.md
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Convert `README.md` to `README.pdf` using the default theme:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
code-down README.md
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Convert with a dark theme and custom output name:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
code-down README.md -o README_dark.pdf -s dark
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Watch a file and rebuild on every save:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
code-down -w notes.md -s light
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Pick a theme interactively:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
code-down themes
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Notes
|
|
145
|
+
|
|
146
|
+
* Ensure your Markdown files are UTF-8 encoded for best results.
|
|
147
|
+
* Supports syntax highlighting for most major programming languages.
|
|
148
|
+
* Works completely offline — no internet connection required (except for `update`).
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# codeDown
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/code-down/)
|
|
4
|
+
[](https://pypi.org/project/code-down/)
|
|
5
|
+
[](https://github.com/bouajilaProg/CodeDown/blob/main/LICENSE)
|
|
6
|
+
[](https://github.com/bouajilaProg/CodeDown/actions/workflows/release.yml)
|
|
7
|
+
[](https://github.com/bouajilaProg/CodeDown/releases/latest)
|
|
8
|
+
|
|
9
|
+
**codeDown** is a simple yet powerful **CLI tool** that converts Markdown (`.md`) files into **beautiful themed PDFs** — complete with **syntax-highlighted code blocks**.
|
|
10
|
+
|
|
11
|
+
Built for developers who love clean documentation, readable code snippets, and automated workflows.
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Features
|
|
16
|
+
|
|
17
|
+
* **Syntax Highlighting** for code blocks
|
|
18
|
+
* **Selectable Themes** – interactive picker or CLI flag (`light`, `dark`)
|
|
19
|
+
* **Watch Mode** – auto-regenerate PDF on file save
|
|
20
|
+
* **Self-Update** – update from the CLI (`code-down update`)
|
|
21
|
+
* **Configurable** – set a default theme via `code-down config set-theme`
|
|
22
|
+
* **Fast & Lightweight** – converts Markdown to PDF in seconds
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Installation
|
|
27
|
+
|
|
28
|
+
### Via pip
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pip install code-down
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### Via binary (Linux)
|
|
35
|
+
|
|
36
|
+
1. **Download the latest release**
|
|
37
|
+
Visit the [Releases Page](https://github.com/bouajilaProg/CodeDown/releases) and download the latest Linux binary.
|
|
38
|
+
|
|
39
|
+
2. **Make it executable and move to PATH**
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
chmod +x code-down
|
|
43
|
+
sudo mv code-down /usr/local/bin/
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Usage
|
|
49
|
+
|
|
50
|
+
Convert a Markdown file into a themed PDF:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
code-down input.md output.pdf -s dark
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Watch mode
|
|
57
|
+
|
|
58
|
+
Automatically rebuild the PDF when the Markdown file changes:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
code-down -w input.md
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### Options
|
|
65
|
+
|
|
66
|
+
| Flag | Description | Default |
|
|
67
|
+
| ----------------- | --------------------------------------- | ----------------------------------- |
|
|
68
|
+
| `-o, --output` | Output PDF file path | Same as input with `.pdf` extension |
|
|
69
|
+
| `-s, --style` | Theme style (e.g. `light`, `dark`) | Config default or `dark` |
|
|
70
|
+
| `-w, --watch` | Watch file and rebuild PDF on changes | |
|
|
71
|
+
| `-v, --version` | Print version and exit | |
|
|
72
|
+
|
|
73
|
+
### Commands
|
|
74
|
+
|
|
75
|
+
| Command | Description |
|
|
76
|
+
| -------------------- | --------------------------------------------- |
|
|
77
|
+
| `code-down themes` | Pick a theme interactively (sets as default) |
|
|
78
|
+
| `code-down config show` | Show current configuration |
|
|
79
|
+
| `code-down config set-theme` | Set the default theme (interactive or by name) |
|
|
80
|
+
| `code-down update` | Update codeDown to the latest version |
|
|
81
|
+
|
|
82
|
+
### Examples
|
|
83
|
+
|
|
84
|
+
Quick test file:
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
code-down examples/example.md
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
Convert `README.md` to `README.pdf` using the default theme:
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
code-down README.md
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
Convert with a dark theme and custom output name:
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
code-down README.md -o README_dark.pdf -s dark
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Watch a file and rebuild on every save:
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
code-down -w notes.md -s light
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Pick a theme interactively:
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
code-down themes
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
---
|
|
115
|
+
|
|
116
|
+
## Notes
|
|
117
|
+
|
|
118
|
+
* Ensure your Markdown files are UTF-8 encoded for best results.
|
|
119
|
+
* Supports syntax highlighting for most major programming languages.
|
|
120
|
+
* Works completely offline — no internet connection required (except for `update`).
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "code-down"
|
|
7
|
+
version = "2.0.1"
|
|
8
|
+
description = "A CLI tool that converts Markdown files into beautifully themed PDFs with syntax-highlighted code blocks."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.9"
|
|
11
|
+
authors = [
|
|
12
|
+
{ name = "bouajila", email = "bouajilamedyessine@gmail.com" }
|
|
13
|
+
]
|
|
14
|
+
dependencies = [
|
|
15
|
+
"markdown>=3.4",
|
|
16
|
+
"pygments>=2.15",
|
|
17
|
+
"weasyprint>=60.0",
|
|
18
|
+
"typer[all]>=0.12.0",
|
|
19
|
+
"click>=8.1.7,<9.0",
|
|
20
|
+
"InquirerPy>=0.3",
|
|
21
|
+
"watchdog>=3.0",
|
|
22
|
+
"requests>=2.28",
|
|
23
|
+
"tomli>=2.0; python_version < '3.11'",
|
|
24
|
+
]
|
|
25
|
+
keywords = ["cli", "markdown", "pdf", "converter", "documentation"]
|
|
26
|
+
license = { file = "LICENSE" }
|
|
27
|
+
classifiers = [
|
|
28
|
+
"Programming Language :: Python :: 3",
|
|
29
|
+
"License :: OSI Approved :: MIT License",
|
|
30
|
+
"Operating System :: OS Independent",
|
|
31
|
+
"Topic :: Utilities",
|
|
32
|
+
]
|
|
33
|
+
|
|
34
|
+
[project.urls]
|
|
35
|
+
Homepage = "https://github.com/bouajilaProg/CodeDown"
|
|
36
|
+
Repository = "https://github.com/bouajilaProg/CodeDown"
|
|
37
|
+
Documentation = "https://github.com/bouajilaProg/CodeDown#readme"
|
|
38
|
+
"Bug Tracker" = "https://github.com/bouajilaProg/CodeDown/issues"
|
|
39
|
+
|
|
40
|
+
[project.scripts]
|
|
41
|
+
code-down = "codedown.__main__:main"
|
|
42
|
+
|
|
43
|
+
[project.optional-dependencies]
|
|
44
|
+
dev = [
|
|
45
|
+
"pytest>=8.0",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[tool.setuptools]
|
|
49
|
+
package-dir = {"" = "src"}
|
|
50
|
+
|
|
51
|
+
[tool.setuptools.packages.find]
|
|
52
|
+
where = ["src"]
|
|
53
|
+
|
|
54
|
+
[tool.setuptools.package-data]
|
|
55
|
+
codedown = ["assets/**/*"]
|
|
56
|
+
|
|
57
|
+
[tool.pytest.ini_options]
|
|
58
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: code-down
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: A CLI tool that converts Markdown files into beautifully themed PDFs with syntax-highlighted code blocks.
|
|
5
|
+
Author-email: bouajila <bouajilamedyessine@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/bouajilaProg/CodeDown
|
|
7
|
+
Project-URL: Repository, https://github.com/bouajilaProg/CodeDown
|
|
8
|
+
Project-URL: Documentation, https://github.com/bouajilaProg/CodeDown#readme
|
|
9
|
+
Project-URL: Bug Tracker, https://github.com/bouajilaProg/CodeDown/issues
|
|
10
|
+
Keywords: cli,markdown,pdf,converter,documentation
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Topic :: Utilities
|
|
15
|
+
Requires-Python: >=3.9
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
Requires-Dist: markdown>=3.4
|
|
18
|
+
Requires-Dist: pygments>=2.15
|
|
19
|
+
Requires-Dist: weasyprint>=60.0
|
|
20
|
+
Requires-Dist: typer[all]>=0.12.0
|
|
21
|
+
Requires-Dist: click<9.0,>=8.1.7
|
|
22
|
+
Requires-Dist: InquirerPy>=0.3
|
|
23
|
+
Requires-Dist: watchdog>=3.0
|
|
24
|
+
Requires-Dist: requests>=2.28
|
|
25
|
+
Requires-Dist: tomli>=2.0; python_version < "3.11"
|
|
26
|
+
Provides-Extra: dev
|
|
27
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
28
|
+
|
|
29
|
+
# codeDown
|
|
30
|
+
|
|
31
|
+
[](https://pypi.org/project/code-down/)
|
|
32
|
+
[](https://pypi.org/project/code-down/)
|
|
33
|
+
[](https://github.com/bouajilaProg/CodeDown/blob/main/LICENSE)
|
|
34
|
+
[](https://github.com/bouajilaProg/CodeDown/actions/workflows/release.yml)
|
|
35
|
+
[](https://github.com/bouajilaProg/CodeDown/releases/latest)
|
|
36
|
+
|
|
37
|
+
**codeDown** is a simple yet powerful **CLI tool** that converts Markdown (`.md`) files into **beautiful themed PDFs** — complete with **syntax-highlighted code blocks**.
|
|
38
|
+
|
|
39
|
+
Built for developers who love clean documentation, readable code snippets, and automated workflows.
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
43
|
+
## Features
|
|
44
|
+
|
|
45
|
+
* **Syntax Highlighting** for code blocks
|
|
46
|
+
* **Selectable Themes** – interactive picker or CLI flag (`light`, `dark`)
|
|
47
|
+
* **Watch Mode** – auto-regenerate PDF on file save
|
|
48
|
+
* **Self-Update** – update from the CLI (`code-down update`)
|
|
49
|
+
* **Configurable** – set a default theme via `code-down config set-theme`
|
|
50
|
+
* **Fast & Lightweight** – converts Markdown to PDF in seconds
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Installation
|
|
55
|
+
|
|
56
|
+
### Via pip
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install code-down
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Via binary (Linux)
|
|
63
|
+
|
|
64
|
+
1. **Download the latest release**
|
|
65
|
+
Visit the [Releases Page](https://github.com/bouajilaProg/CodeDown/releases) and download the latest Linux binary.
|
|
66
|
+
|
|
67
|
+
2. **Make it executable and move to PATH**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
chmod +x code-down
|
|
71
|
+
sudo mv code-down /usr/local/bin/
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
---
|
|
75
|
+
|
|
76
|
+
## Usage
|
|
77
|
+
|
|
78
|
+
Convert a Markdown file into a themed PDF:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
code-down input.md output.pdf -s dark
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Watch mode
|
|
85
|
+
|
|
86
|
+
Automatically rebuild the PDF when the Markdown file changes:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
code-down -w input.md
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Options
|
|
93
|
+
|
|
94
|
+
| Flag | Description | Default |
|
|
95
|
+
| ----------------- | --------------------------------------- | ----------------------------------- |
|
|
96
|
+
| `-o, --output` | Output PDF file path | Same as input with `.pdf` extension |
|
|
97
|
+
| `-s, --style` | Theme style (e.g. `light`, `dark`) | Config default or `dark` |
|
|
98
|
+
| `-w, --watch` | Watch file and rebuild PDF on changes | |
|
|
99
|
+
| `-v, --version` | Print version and exit | |
|
|
100
|
+
|
|
101
|
+
### Commands
|
|
102
|
+
|
|
103
|
+
| Command | Description |
|
|
104
|
+
| -------------------- | --------------------------------------------- |
|
|
105
|
+
| `code-down themes` | Pick a theme interactively (sets as default) |
|
|
106
|
+
| `code-down config show` | Show current configuration |
|
|
107
|
+
| `code-down config set-theme` | Set the default theme (interactive or by name) |
|
|
108
|
+
| `code-down update` | Update codeDown to the latest version |
|
|
109
|
+
|
|
110
|
+
### Examples
|
|
111
|
+
|
|
112
|
+
Quick test file:
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
code-down examples/example.md
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Convert `README.md` to `README.pdf` using the default theme:
|
|
119
|
+
|
|
120
|
+
```bash
|
|
121
|
+
code-down README.md
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
Convert with a dark theme and custom output name:
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
code-down README.md -o README_dark.pdf -s dark
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
Watch a file and rebuild on every save:
|
|
131
|
+
|
|
132
|
+
```bash
|
|
133
|
+
code-down -w notes.md -s light
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Pick a theme interactively:
|
|
137
|
+
|
|
138
|
+
```bash
|
|
139
|
+
code-down themes
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Notes
|
|
145
|
+
|
|
146
|
+
* Ensure your Markdown files are UTF-8 encoded for best results.
|
|
147
|
+
* Supports syntax highlighting for most major programming languages.
|
|
148
|
+
* Works completely offline — no internet connection required (except for `update`).
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
pyproject.toml
|
|
3
|
+
src/code_down.egg-info/PKG-INFO
|
|
4
|
+
src/code_down.egg-info/SOURCES.txt
|
|
5
|
+
src/code_down.egg-info/dependency_links.txt
|
|
6
|
+
src/code_down.egg-info/entry_points.txt
|
|
7
|
+
src/code_down.egg-info/requires.txt
|
|
8
|
+
src/code_down.egg-info/top_level.txt
|
|
9
|
+
src/codedown/__init__.py
|
|
10
|
+
src/codedown/__main__.py
|
|
11
|
+
src/codedown/cli.py
|
|
12
|
+
src/codedown/config.py
|
|
13
|
+
src/codedown/converter.py
|
|
14
|
+
src/codedown/paths.py
|
|
15
|
+
src/codedown/themes.py
|
|
16
|
+
src/codedown/updater.py
|
|
17
|
+
src/codedown/watcher.py
|
|
18
|
+
src/codedown/assets/themes/base.css
|
|
19
|
+
src/codedown/assets/themes/dark.css
|
|
20
|
+
src/codedown/assets/themes/dark.toml
|
|
21
|
+
src/codedown/assets/themes/light.css
|
|
22
|
+
src/codedown/assets/themes/light.toml
|
|
23
|
+
tests/test_argv_rewrite.py
|
|
24
|
+
tests/test_cli_commands.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
codedown
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
from codedown.cli import app
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
_SUBCOMMANDS = {"convert", "config", "themes", "update"}
|
|
8
|
+
_CONVERT_LEADING_OPTIONS = {"-w", "--watch", "-s", "--style", "-o", "--output"}
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _rewrite_argv_for_implicit_convert(argv: list[str]) -> list[str]:
|
|
12
|
+
if len(argv) < 2:
|
|
13
|
+
return argv
|
|
14
|
+
|
|
15
|
+
first = argv[1]
|
|
16
|
+
|
|
17
|
+
# Let click/typer handle help/version and explicit subcommands.
|
|
18
|
+
if first in {"-h", "--help", "-v", "--version"}:
|
|
19
|
+
return argv
|
|
20
|
+
if first in _SUBCOMMANDS:
|
|
21
|
+
return argv
|
|
22
|
+
|
|
23
|
+
# Support: code-down -w file.md (and -s/-o before the file)
|
|
24
|
+
if first in _CONVERT_LEADING_OPTIONS:
|
|
25
|
+
return [argv[0], "convert", *argv[1:]]
|
|
26
|
+
|
|
27
|
+
# Support: code-down file.md
|
|
28
|
+
p = Path(first)
|
|
29
|
+
if p.exists() or first.lower().endswith(".md"):
|
|
30
|
+
return [argv[0], "convert", *argv[1:]]
|
|
31
|
+
|
|
32
|
+
return argv
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
def main():
|
|
36
|
+
sys.argv = _rewrite_argv_for_implicit_convert(sys.argv)
|
|
37
|
+
app()
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
if __name__ == "__main__":
|
|
41
|
+
main()
|