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

fix: Run on_page_markdown event "first" #130

Merged
merged 1 commit into from Oct 16, 2022
Merged

fix: Run on_page_markdown event "first" #130

merged 1 commit into from Oct 16, 2022

Conversation

prcr
Copy link
Contributor

@prcr prcr commented Oct 15, 2022

Updates on_page_markdown so that it runs before the events from other plugins (as described on mkdocs/mkdocs#2973).

Extra context

After upgrading to mkdocs==1.4.0 and mkdocs-include-markdown-plugin==3.9.0, I started having the following errors when building my site:

$ mkdocs build
INFO     -  Cleaning site directory
INFO     -  Building documentation to directory: /home/prcr/git/docs/site
INFO     -  [macros] - ERROR # _Macro Syntax Error_
            _Line 13 in Markdown file:_ **expected token 'end of statement block', got 'string'**
            ```python
                    include-markdown "../assets/includes/self-hosted-version.txt"
            ```
INFO     -  [macros] - ERROR # _Macro Syntax Error_
            _Line 13 in Markdown file:_ **expected token 'end of statement block', got 'string'**
            ```python
                    include-markdown "../assets/includes/self-hosted-version.txt"
            ```

This is because another plugin that I'm using, mkdocs-macros-plugin==0.7.0, fails to parse the mkdocs-include-markdown-plugin syntax in the Markdown pages.

In practice, the mkdocs-include-markdown-plugin should be one of the very first plugins to run so that the subsequent plugins work on top of the Markdown that already has the included content, as described on the README.

@coveralls
Copy link

coveralls commented Oct 15, 2022

Pull Request Test Coverage Report for Build 3255930404

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 99.476%

Totals Coverage Status
Change from base Build 3145936847: 0.0%
Covered Lines: 380
Relevant Lines: 382

💛 - Coveralls

Copy link
Owner

@mondeja mondeja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I had not understood the decorator 😅 Thank you for the patch!

@mondeja mondeja added the bug fix Something has been solved label Oct 15, 2022
@mondeja mondeja merged commit ed98477 into mondeja:master Oct 16, 2022
@prcr prcr deleted the patch-1 branch October 17, 2022 08:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Something has been solved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants