rnorth / mkdocs-codeinclude-plugin

MIT License
14 stars 8 forks source link

Allow selectors on next line #10

Closed dmitry-timofeev closed 4 years ago

dmitry-timofeev commented 4 years ago

Allows targeting expressions to be on the next line:

<!--codeinclude-->
<!-- On the same line -->
[Title](long/long/Path) targeting_expr1

<!-- On the next line -->
[Title2](long/long/Path)
targeting_expr2
<!--/codeinclude-->

I kept the usage of a regular expression to find the include definitions, but had to change the implementation to use re.findall and a multiline expression instead of re.match over a single line.

The processing is now separated into three stages:

  1. Code-include block extraction.
  2. Computing substitutes (patches) for each block.
  3. Application of patches to the original markdown.

Resolves #9

dmitry-timofeev commented 4 years ago

Just in case it helps with the review, I keep a develop branch with all the open PRs merged into it (and merge conflicts resolved): https://github.com/exonum/mkdocs-codeinclude-plugin/tree/develop

rnorth commented 4 years ago

Trying to unpick these and forming a larger PR, #22, where I'll resolve the conflicts that have arisen