Hi Bennet -
It works for me, but I'm using CommonMark 0.5.4 vs your 0.6.3? Maybe the
newer version of CommonMark removed or renamed DocParser? <goes off to
dig around on GitHub>
Yup, looks like `DocParser` was renamed to `Parser` in v0.6.0
https://github.com/rtfd/CommonMark-py/pull/40/commits/e5e32bbd47db22caf2db02a035f10f96c120a5d7
I just filed that as an issue against the lesson-template repo.
https://github.com/swcarpentry/lesson-template/issues/299
Some other thoughts on what else could potentially go wrong:
The process for the R-gapminder lesson is usually just `make check` and
then `make preview`. 'make check' will throw a bunch of errors/warnings
because not all the lessons have been built to 'spec'. We're working on
it; there are open issues to fix these warnings/errors on the
r-novice-gapminder GH repo. `make preview` should work fine despite
these errors, however.
To run `make preview` you'll need to have knitr and its requirements
installed, and you may need to make sure you have the latest pandoc
version. Basically the makefile just runs knitr on all the Rmd files to
generate md, then calls pandoc to turn the md to html.
In this repo, requirement.txt only includes CommonMark, pandocfilters,
PyYAML, and update-copyright. It doesn't include the R packages or the
latest version of pandoc.
It may not rebuild/re-run `knitr::knit()` if there haven't been any
changes in the source as compared to the output files (since the repo
contains both the source and the rendered output).
John Blischak wrote a great blog post on an overview of how the R lesson
repos work a few weeks ago that might be helpful to get oriented?
http://software-carpentry.org//blog/2016/04/maintaining-a-lesson.html
HTH,
Naupaka
On 19 Apr 2016, at 10:58, Bennet Fauber wrote:
I installed Pandoc and the requirements as listed in the
requirements.txt file from the r-novice-gapminder lesson, but I get an
error about a missing function in CommonMark.
I ran
$ pip install -r requirements.txt
using a freshly downloaded Anaconda2 (and again with Anaconda3, just
in case), and that went fine. CommonMark 0.6.3 is installed.
However, running make from the r-novice-gapminder folder throws the
error
AttributeError: 'module' object has no attribute 'DocParser'
Below is a transcript showing the pip install, an IPython session
where I used Tab-completion to list the contents of CommonMark, and
finally the output of make.
It actually appears that other make targets work, though I'm not
entirely clear on the process for R, as make didn't seem to run the
.Rmd file through knitr. I am missing something obvious. What?
Thanks, -- bennet
Transcript
----
[stentorian:r-novice-gapminder bennet]$ pip install -r
requirements.txt
Collecting CommonMark (from -r requirements.txt (line 1))
Using cached CommonMark-0.6.3-py2.py3-none-any.whl
Collecting pandocfilters (from -r requirements.txt (line 2))
Downloading pandocfilters-1.3.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): PyYAML in
/Users/bennet/anaconda2/lib/python2.7/site-packages (from -r
requirements.txt (line 3))
Collecting update-copyright (from -r requirements.txt (line 4))
Downloading update-copyright-0.6.2.tar.gz
Collecting future (from CommonMark->-r requirements.txt (line 1))
Using cached future-0.15.2.tar.gz
Building wheels for collected packages: pandocfilters,
update-copyright, future
Running setup.py bdist_wheel for pandocfilters ... done
Stored in directory:
/Users/bennet/Library/Caches/pip/wheels/f0/45/06/df26739ffe8b804ab4be4ffb0b93cdcc95d4497648a9ec9547
Running setup.py bdist_wheel for update-copyright ... done
Stored in directory:
/Users/bennet/Library/Caches/pip/wheels/2b/94/1f/f9fb3104df8bb64b0dbbd4254623fccb7772231afb6d6f9ce2
Running setup.py bdist_wheel for future ... done
Stored in directory:
/Users/bennet/Library/Caches/pip/wheels/d9/04/36/6bd807b5148e7c929d8f0991cc943a81f3287030a1b352e3fc
Successfully built pandocfilters update-copyright future
Installing collected packages: future, CommonMark, pandocfilters,
update-copyright
Successfully installed CommonMark-0.6.3 future-0.15.2
pandocfilters-1.3.0 update-copyright-0.6.2
[stentorian:r-novice-gapminder bennet]$ which python
/Users/bennet/anaconda2/bin/python
[stentorian:r-novice-gapminder bennet]$ make check
python tools/check.py .
Traceback (most recent call last):
File "tools/check.py", line 845, in <module>
main(parsed_args)
File "tools/check.py", line 830, in main
res = validate_single(fn, template=template)
File "tools/check.py", line 710, in validate_single
validate_file = validator(filepath)
File "tools/check.py", line 80, in __init__
ast = self._parse_markdown(self.markdown)
File "tools/check.py", line 87, in _parse_markdown
parser = CommonMark.DocParser()
AttributeError: 'module' object has no attribute 'DocParser'
make: *** [check] Error 1
[stentorian:r-novice-gapminder bennet]$ ipython
Python 2.7.11 |Anaconda 4.0.0 (x86_64)| (default, Dec 6 2015,
18:57:58)
Type "copyright", "credits" or "license" for more information.
IPython 4.1.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import CommonMark
In [2]: CommonMark.
CommonMark.ASTtoJSON CommonMark.commonmark
CommonMark.CommonMark CommonMark.dumpAST
CommonMark.HtmlRenderer CommonMark.entitytrans
CommonMark.Parser CommonMark.html
CommonMark.absolute_import CommonMark.inlines
CommonMark.blocks CommonMark.node
CommonMark.common CommonMark.unicode_literals
In [2]: exit
_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org
_______________________________________________
Discuss mailing list
[email protected]
http://lists.software-carpentry.org/mailman/listinfo/discuss_lists.software-carpentry.org