Skip to content

Commit

Permalink
chore(release): bump version to 0.1.2
Browse files Browse the repository at this point in the history
  • Loading branch information
theiskaa committed Dec 1, 2024
1 parent 15d8fcb commit 819234b
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 18 deletions.
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,18 @@ the changelog generator (git-cliff).

---

## [0.1.1] - 2024-11-29
## [0.1.2] - 2024-12-01
### Features
- *(cli)* Add URL input support for remote markdown files
- *(assets)* Embed the help text file to assets

### Bug Fixes
- *(markdown)* Remove the token printing in markdown parser

### Refactor
- *(bin)* Re-implement the structure of cli

## [0.1.1] - 2024-11-29
### Features
- *(pdf)* Implement hierarchical list rendering with proper indentation
- *(markdown)* Support mixed ordered/unordered nested lists
Expand Down Expand Up @@ -36,7 +46,6 @@ the changelog generator (git-cliff).
* @orhun made their first contribution

## [0.1.0] - 2024-11-17

### Features
- *(docs)* Update readme
- *(docs)* Add contributing document
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "markdown2pdf"
version = "0.1.1"
version = "0.1.2"
edition = "2021"
authors = ["Ismael Sh <[email protected]>"]
description = "Create PDF with Markdown files (a md to pdf transpiler)"
Expand Down
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@ cargo add markdown2pdf

Or add the following line to your Cargo.toml:
```toml
markdown2pdf = "0.1.1"
markdown2pdf = "0.1.2"
```

## Usage
To use the `markdown2pdf` tool, you can either specify a Markdown file path, provide Markdown content directly, or set the output PDF path.

### Options
- `-p`, `--path`: Specify the path to the Markdown file to convert.
- `-s`, `--string`: Provide Markdown content directly as a string.
- `-u`, `--url`: Specify a URL to fetch Markdown content from.
- `-o`, `--output`: Specify the output file path for the generated PDF.

### Examples
Expand All @@ -45,25 +45,25 @@ To use the `markdown2pdf` tool, you can either specify a Markdown file path, pro
markdown2pdf -p "docs/resume.md" -o "resume.pdf"
```

This will convert the `resume.md` file located in the `docs` folder to a PDF file named `resume.pdf`.
Convert the 'resume.md' file in the 'docs' folder to 'resume.pdf'.

2. Convert Markdown content provided as a string:
```bash
markdown2pdf -s "# My Markdown Title\n\nThis is content." -o "output.pdf"
markdown2pdf -s "**bold text** *italic text*." -o "output.pdf"
```

This will convert the provided Markdown string to a PDF file named `output.pdf`.
Convert the provided Markdown string to 'output.pdf'.

3. Convert a Markdown file to a PDF with default output:
3. Convert Markdown from a URL:
```bash
markdown2pdf -p "file.md"
markdown2pdf -u "https://raw.githubusercontent.com/user/repo/main/README.md" -o "readme.pdf"
```

This will convert the `file.md` to a PDF and save it as `output.pdf`.
Convert the Markdown content from the URL to 'readme.pdf'.

### Notes
- If both `-p` and `-s` options are provided, the `--path` option will take precedence.
- If no output file is specified using the `-o` option, the default output file will be named `output.pdf`.
- If multiple input options (-p, -s, -u) are provided, only one will be used in this order: path > url > string
- If no output file is specified with `-o`, the default output file will be 'output.pdf'.

## Using as Library
The library at its core employs a lexical analyzer that tokenizes the input Markdown text into semantic elements like headings, emphasis, code blocks, and lists. The lexer handles nested structures and maintains proper context during parsing. After lexical analysis, the tokens are processed through a styling engine that applies visual formatting based on configuration rules. The styling engine supports customization of fonts, colors, spacing, and other typographic properties through a TOML configuration file.
Expand Down
7 changes: 4 additions & 3 deletions assets/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Source: https://github.com/theiskaa/markdown2pdf
Options:
-p, --path Specify the path to the Markdown file to convert.
-s, --string Provide Markdown content directly as a string.
-u, --url Specify a URL to fetch Markdown content from.
-o, --output Specify the output file path for the generated PDF.

Examples:
Expand All @@ -20,9 +21,9 @@ Examples:
markdown2pdf -s "**bold text** *italic text*." -o "output.pdf"
Convert the provided Markdown string to 'output.pdf'.

markdown2pdf -p "file.md"
Convert 'file.md' to a PDF, saving it as 'output.pdf'.
markdown2pdf -u "https://raw.githubusercontent.com/user/repo/main/README.md" -o "readme.pdf"
Convert the Markdown content from the URL to 'readme.pdf'.

Notes:
- If both `-p` and `-s` options are provided, the `--path` option will take precedence.
- If multiple input options (-p, -s, -u) are provided, only one will be used in this order: path > url > string
- If no output file is specified with `-o`, the default output file will be 'output.pdf'.
6 changes: 5 additions & 1 deletion cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ the changelog generator (git-cliff).
"""

[changelog.remote]
remote_url = "https://github.com/theiskaa/markdown2pdf"

body = """
{% if version %}\
{% if previous.version %}\
Expand Down Expand Up @@ -42,6 +45,7 @@ body = """
{%- endfor -%}
{%- endif %}\n\n
"""

# template for the changelog footer
footer = ""

Expand All @@ -51,8 +55,8 @@ trim = true
postprocessors = [
{ pattern = '<REPO>', replace = "https://github.com/theiskaa/markdown2pdf" },
]
render_always = true
output = "CHANGELOG.md"
render_always = true

[git]
conventional_commits = true
Expand Down

0 comments on commit 819234b

Please sign in to comment.