Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pandocomatic 2.0.0 #193328

Merged
merged 2 commits into from
Oct 9, 2024
Merged

pandocomatic 2.0.0 #193328

merged 2 commits into from
Oct 9, 2024

Conversation

BrewTestBot
Copy link
Member

@BrewTestBot BrewTestBot commented Oct 9, 2024

Created by brew bump


Created with brew bump-formula-pr.

  • resource blocks have been checked for updates.
release notes
I've added two new features: logging and feature toggles. Because the log is more detailed than the already existing debug information printed when you used pandocomatic's `--debug` command-line option, I've removed that command-line option. However, as that's a breaking change, I've created a new major version of pandocomatic: 2.0.0.

Logging

Pandocomatic 2.0.0 adds logging to pandocomatic. Use the log to investigate and understand your conversion process in detail. Use new command-line options --log [FILE] and --log-level [LEVEL] to control pandocomatic's logging. Use them as follows:

  • -l [FILE], --log [FILE]

    Let pandocomatic log what it is doing to FILE. If FILE is not given, pandocomatic uses 'pandocomatic.log'. Control detail of logging with option '--log-level'.

  • --log-level [LEVEL]

    Let pandocomatic log with detail LEVEL. LEVEL should be one of 'fatal', 'error', 'warn', 'info', or 'debug'. By default, pandocomatic logs at detail level info. Choose level 'debug' to see all steps pandocomatic takes to convert every directory and file.

When using the "debug" detail level, pandocomatic will log the full conversion process in a structured way. Using this log, you can see exactly what steps pandocomatic took when converting a file or directory. It'll allow you to perform the same steps manually and investigate the conversion process.

For example, part of the log when running a test looks like:

2024-10-09 07:49:15 INFO : (1)   - convert index.md -> index.html
2024-10-09 07:49:15 DEBUG:   #  Using template 'wiki-page'.
2024-10-09 07:49:15 DEBUG:   #  Selected template mixed with internal template and pandocomatic metadata gives final template:
                                  extends: []
                                  glob:
                                  - "*.md"
                                  setup:
                                  - scripts/create_temp_file.sh
                                  preprocessors:
                                  - preprocessors/now.rb
                                  metadata: {}
                                  pandoc:
                                    from: markdown
                                    to: html5
                                    standalone: true
                                    template: templates/wiki.html
                                  postprocessors:
                                  - postprocessors/branding.rb
                                  cleanup: []
2024-10-09 07:49:15 DEBUG:      #  Running setup:
2024-10-09 07:49:15 DEBUG:      |  /home/pandocomatic-user/example/data-dir/scripts/create_temp_file.sh
2024-10-09 07:49:15 DEBUG:   →  Reading source file: '/home/pandocomatic-user/example/src/setup-cleanup-wiki/index.md'
2024-10-09 07:49:15 DEBUG:      | FileInfoPreprocessor. Adding file information to metadata:
                                     pandocomatic-fileinfo:
                                       from: markdown
                                       to: html5
                                       template: templates/wiki.html
                                       path: '/home/pandocomatic-user/example/src/setup-cleanup-wiki/index.md'
                                       src_path: '/home/pandocomatic-user/example/src/setup-cleanup-wiki'
                                       created: 2024-05-22
                                       modified: 2024-05-04
2024-10-09 07:49:15 DEBUG:      #  Running preprocessors:
2024-10-09 07:49:15 DEBUG:      |  /home/pandocomatic-user/example/data-dir/preprocessors/now.rb
2024-10-09 07:49:15 DEBUG:      #  Changing directory to '/home/pandocomatic-user/example/src/setup-cleanup-wiki'
2024-10-09 07:49:15 DEBUG:      #  Running pandoc
2024-10-09 07:49:15 DEBUG:      |  pandoc       --from=markdown \
                                                --to=html5 \
                                                --standalone \
                                                --template=/home/pandocomatic-user/example/data-dir/templates/wiki.html
2024-10-09 07:49:15 DEBUG:      #  Running postprocessors:
2024-10-09 07:49:15 DEBUG:      |  /home/pandocomatic-user/example/data-dir/postprocessors/branding.rb
2024-10-09 07:49:15 DEBUG:   ←  Writing output to '/tmp/setup_cleanup20241009-42-uqczz2/setup-cleanup-wiki/index.html'.

Feature toggles

From pandocomatic 2.0.0 on, pandocomatic also supports feature toggles. Use command-line option --enable FEATURE to enable a feature.

At the moment, pandocomatic only support feature toggle "pandoc-verbose". By default, pandocomatic does not forward pandoc's "--verbose" option to pandoc when you set it in a template because the output of pandoc's verbose mode might interfere with the working of pandocomatic processors and pandoc's filters. However, if you want, you can force pandocomatic to adhere to the template and pass on the "--verbose" option to pandoc by using command-line option --enable pandoc-verbose.

@github-actions github-actions bot added ruby Ruby use is a significant feature of the PR or issue bump-formula-pr PR was created using `brew bump-formula-pr` labels Oct 9, 2024
pandocomatic: update deps

Signed-off-by: Rui Chen <rui@chenrui.dev>
Copy link
Contributor

github-actions bot commented Oct 9, 2024

🤖 An automated task has requested bottles to be published to this PR.

@github-actions github-actions bot added the CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. label Oct 9, 2024
@BrewTestBot BrewTestBot added this pull request to the merge queue Oct 9, 2024
Merged via the queue into master with commit 3c0230c Oct 9, 2024
15 checks passed
@BrewTestBot BrewTestBot deleted the bump-pandocomatic-2.0.0 branch October 9, 2024 14:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump-formula-pr PR was created using `brew bump-formula-pr` CI-published-bottle-commits The commits for the built bottles have been pushed to the PR branch. ruby Ruby use is a significant feature of the PR or issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants