simplistix / sybil

Automated testing for the examples in your documentation.
https://sybil.readthedocs.io/en/latest/
Other
74 stars 14 forks source link

Non-MyST Flavored Markdown support #99

Closed cjw296 closed 12 months ago

cjw296 commented 1 year ago

@hynek - Can you have a look over this? In particular the docs. From looking at the svcs repo, it doesn't appear you have any example in your source code, your README is in GFM and docs are in Sphinx. Is that right, and is that the way you want it to stay?

One thing you may want, which isn't in this PR but will be in the next release, is to have an unconditional skip result in a skipped test:


<!-- skip: "XXX FIXME TYODO" -->

Currently, unconditional skips only ever result in the skipped example silently passing, which makes it hard to remember to go back and fix them ;-)

hynek commented 1 year ago

CleanShot 2023-10-25 at 08 06 58@2x

what have you done Chris /o\

cjw296 commented 1 year ago

GFM is basically a subset of MyST, as best I can tell, so it's largely the documentation, but also parsers that won't pick up the %-style comments that MyST uses.

cjw296 commented 1 year ago

Okay, and the docs for this PR are here, chicken and egg with creating the PR.

hynek commented 1 year ago

There's one thing to get out of the way first: inline HTML comments are in no way specific to GFM. Inline HTML is even part of Gruber's original specification: https://daringfireball.net/projects/markdown/syntax#html

That means it should perfectly work with MyST too. Is there anything else specific to GFM in the implementation? Can't find anything on a first look.

cjw296 commented 1 year ago

As I said, GFM is a subset of MyST, so sure, inline html comments work fine with the Myst parsers, they're even in the docs ;-) (I actually fixed up a lot of this in https://github.com/simplistix/sybil/pull/94, which landed this week)

It's more that these docs are focused on folks who aren't using MyST, and who may not even know what MyST is.

hynek commented 1 year ago

Yeah but what I mean is: what is actually GFM about your GFM support? It looks like vanilla Markdown to me?

cjw296 commented 1 year ago

I don't know, you tell me? :-) (I don't really use Markdown, which is why I want you to review this PR!) My thought process is:

cjw296 commented 1 year ago

@hynek - last call on this, would appreciate your review on it but I'm planning a 6.0.0 release sometime in the next day or few and I intend to land this PR for it...

hynek commented 1 year ago

I have scrolled through the docs in the PR and my feedback remains the same: unless I'm missing anything, all you're doing is looking into <--! FOO --> in addition to % FOO.

If that's indeed what you're doing, you shouldn't call it GFM. Just call it sybil.markdown or sybil.commonmark. Otherwise you'll detract/irritate users of platforms that also support Markdown but not the GitHub-flavored kind. Just say "Markdown, including GitHub-flavored Markdown (GFM), ..." and call it a day?

As for the contents (again, only judging the docs), as long as I can replace my multi-line skips with <--! skip --> I'm a happy camper.

And yes, I try to avoid having doctests within docstrings. It's just not a good editing experience. I add them in the API docs like in https://github.com/hynek/stamina/blob/ddb5b19a7e2706a49cbeb4d65352d165f9e444c2/docs/api.md?plain=1#L29-L56

cjw296 commented 12 months ago

I hadn't realised markdown users were such delicate flowers ;-)

Anyway, taken on board and renamed. I'm going to land this PR now, but if you spot anything else problematic, let me know and I'll try and correct it before the next release.

hynek commented 12 months ago

Well it's more anti-GitHub contrarians I'm thinking of ;)

cjw296 commented 11 months ago

🤷 - we're all Microsoft customers now, just as intended ;-)