Open msabramo opened 9 years ago
Hm yeah the fact that GitHub doesn’t render pycon
is the sole reason why my projects don’t have their teasers in the README – good to know it’s gonna change soon!
One thing though: the docs include the contents of the README (see https://raw.githubusercontent.com/hynek/characteristic/master/docs/index.rst ) so as of now the teaser would appear twice.
Oh should I amend this to remove the teaser from index.rst?
yeah, just build the sphinx docs (make html) and see for yourself. :)
OK, updated.
Ahhhhh now I remember the right reason…pycon
works but doctest
doesn’t!
Do you think there’s a chance to convince GitHub to support doctest
too? I really like to verify my examples. :)
Thanks for helping!
Testing...
pycon
>>> a = {'animal': 'dog'}
>>> a
{'animal': 'dog'}
>>> print('yay')
yay
doctest
>>> a = {'animal': 'dog'}
>>> a
{'animal': 'dog'}
>>> print('yay')
yay
@hynek:
Do you think there’s a chance to convince GitHub to support doctest too?
Well, we'll see what happens -- https://github.com/atom/language-python/pull/49 :smile:
https://github.com/atom/language-python/pull/49 merged. So doctest
should work in a few weeks. :smile:
w00t! Could you switch it back to doctest
then?
Done.
Hmmmm, Pygments doesn't support a doctest
lexer; only pycon
. What to do?
Just updated this so that README.rst
includes the example as pycon
and I moved .. begin
after the teaser so the teaser doesn't appear twice in sphinx docs.
Preview README.rst
at https://github.com/msabramo/characteristic/blob/README_teaser/README.rst
How does that look?
I will play with this before I release 15.0. Maybe it’s possible to extract two parts. ponder
Because a teaser on the PyPI page is nice and changing the lexer from
doctest
topycon
will allow it to render in nice color on PyPI (and in the future on GitHub, when https://github.com/github/linguist/issues/1939 gets deployed).Preview at https://github.com/msabramo/characteristic/tree/README_teaser
Preview of how it will look on GitHub when they deploy https://github.com/github/linguist/issues/1939 to production: lightshow