sphinx-contrib / sphinxcontrib-towncrier

An RST directive for injecting a Towncrier-generated changelog draft containing fragments for the unreleased (next) project version. Demo: https://ansible-pylibssh.rtfd.io/changelog. Docs: https://sphinxcontrib-towncrier.rtfd.io
https://pypi.org/p/sphinxcontrib-towncrier
BSD 3-Clause "New" or "Revised" License
19 stars 18 forks source link

Escape RST substitution only when needed #57

Closed davfsa closed 2 years ago

davfsa commented 2 years ago

I was running into some issues with a random \ being added at the beginning of my draft changelog. I am not using the default RST parser, instead I am making use of a Markdown one, which made the character visible instead of rendering as an empty character.

Hopefully adding it only when needed is a valid solution to this issue! Let me know if there is anything I am missing from the PR.

Would also like to kindly ask for a release when this PR is merged, as the project seems stable enough and doesnt receive any consistent releases :)

webknjaz commented 2 years ago

Would also like to kindly ask for a release when this PR is merged, as the project seems stable enough and doesnt receive any consistent releases :)

It's quite stable, yes. I've been holding off dropping the alpha marker, though, until there's decent testing implemented...

webknjaz commented 2 years ago

instead I am making use of a Markdown one, which made the character visible instead of rendering as an empty character.

Oh, that's interesting. Are you talking about MyST? I don't think I've faced problems with it. Do you have an example project where this is happening?

webknjaz commented 2 years ago

pre-commit.ci run

davfsa commented 2 years ago

instead I am making use of a Markdown one, which made the character visible instead of rendering as an empty character.

Oh, that's interesting. Are you talking about MyST? I don't think I've faced problems with it. Do you have an example project where this is happening?

I am currently away from a pc, so won't be possible for a bit, but will show as soon as I can (maybe in 1 or 2 days)

davfsa commented 2 years ago

Oh, that's interesting. Are you talking about MyST? I don't think I've faced problems with it. Do you have an example project where this is happening?

Yep, im using MyST. This is what my changelog.md file looks like

# Changelog

```{attention}
Mayor and minor releases also include the changes specified in prior development releases.
webknjaz commented 2 years ago

@davfsa oh, now I see why I've never seen this issue: https://github.com/ansible/ansible-navigator/blob/4e333de/docs/changelog.md?plain=1#L22 — I just didn't set the version title value.

codecov[bot] commented 2 years ago

Codecov Report

Merging #57 (0d4871a) into master (ec5218e) will increase coverage by 1.79%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##           master      #57      +/-   ##
==========================================
+ Coverage   42.58%   44.37%   +1.79%     
==========================================
  Files           4        5       +1     
  Lines         155      160       +5     
==========================================
+ Hits           66       71       +5     
  Misses         89       89              
webknjaz commented 2 years ago

This has been released in v0.3.0a0: https://pypi.org/project/sphinxcontrib-towncrier/0.3.0a0/.