I've found this post Jekyll, modify the way some html tags are rendered
Which does explain how to extend redcarpet itself.
But what else needs to be done in order to get such extension to work?
What name does the extension correspond to in the _config.yml ?
Do I need to include anything in my gem file?
If I simply change "markdown: redcarpet" to "markdown: RedcarpetMod" github pages will send a main telling me that there were syntax errors in the first markdown file it tries to process.
Your stumbling block here is GitHub pages — the answer given by #cyrusza in the question you've linked works fine (I am using it to modify redcarpet's rendering on one of my sites). GitHub pages, however, runs in safe mode which means that it does not allow custom plugins at all and instead only supports a few specific plugins.
Check the Plugins page in the Jekyll documentation for the note about safe mode (in the first blue box), and the GitHub Pages help page about plugins for the list of which plugins are allowed.
Related
I have lot of documentation written in AsciiDoc and correctly separated into folders. I use asciidoctor with a custom CSS to render my docs to HTML. The problem with this is that it generates a single HTML page that is very long. I was surfing the web and found that the atom docs are also written in AsciiDoc, but these docs have not all the information together, in fact they are separated into different sections.
Here the atom docs: https://atom.io/docs/v0.201.0/getting-started-why-atom
I want to know if there is a tool that can generate this, a flag or a specific syntax.
I think it is not really user friendly to have all the info in one long single page.
I have a site where the static content is generated using the asciidoctor-jekyll plugin and jekyll.
I had also plugged the java version of asciidoctor to generate views with the play framework at some point but decided that I prefer that the content I generate with asciidoctor to be static and delivered by a CDN.
EDIT:
Also, GitBookIO supports asciidoctor.
I've written some using documentation for a ruby gem. I'm using yard to generate the ruby gem reference documentation from the ruby source, and I want yard to work with this other markdown documentation.
I've written the documentation within the gitlab wiki which uses the same markdown as github and all the links to anchors work.
When I use yard to generate html from the markup two things go wrong. The first is the links didn't work because in the markdown references to other files didn't include an extension e.g. [Getting Started] (Introduction#getting-started) which worked in the wiki but yard needs a [Getting Started] (Introduction.html#getting-started). I was able to get around this by writing a rewrite rule in the .htaccess file.
The second issue is harder. The wiki generated anchors to headings are like as above, whereas yard anchors are: Introduction.html#Getting_Started
I've tried sorting out the case issue by adding [NC] in the .htaccess file but this didn't help. Plus there is the issue of the "-" changing to a "_".
The relevant bits from my .yardopts file in relation to my question are:
--markup markdown
--markup-provider redcarpet
My question is:
Is the structure of the generated anchors due to either the choice of markup or markup provider? I'm confused by these terms and I've not been able to find useful documentation about them.
I've got the github-markup gem installed and I've tried replacing markdown with github-markup, and that didn't work, then I tried replace redcarpet with github-markup but that also doesn't work.
I keep searching for documentation to try and understand what I'm doing here without gaining any clarity thus the clutching at straws.
I'm using a slightly modified version of the example generator from Jekyll's plugins section of their docs (https://github.com/mojombo/jekyll/wiki/Plugins#generators) and I'm curious if there is any way to parse a liquid/markdown file instead of a plain HTML files from the example?
Notice this line:
self.read_yaml(File.join(base, '_layouts'), 'category_index.html')
That category index.html file is the target file which will be used in generated files. My goal is to be able to pass an object to a my generator from my _config file which I can then use to build a bunch of pages from a .markdown file instead. Does anyone know if this is possible or have any recommendations for achieving this? I looked into the Kramdown lib that's used to parse markdown internally, and I'm not opposed to invoking it myself if I have to, just wasn't sure if I was going deeper than I needed to for something that should be so simple. The API for the Page object which my generator creates is here: http://ruby-doc.org/gems/docs/j/jekyll-0.12.0/Jekyll/Page.html
Thanks a ton,
- Keith
You can generate virtually any format you want, from virtually any data source you want, in a generator, because you're writing straight Ruby with full access to the Jekyll object model. For example, here's a generator I put together the other night that fetches GitHub commits during jekyll build.
The question I would be asking is this:
Do I need a plugin to accomplish this?
If so, do I need a formal generator plugin as discussed in the Jekyll docs?
Or should I subclass, monkey-patch, or otherwise change the behavior of the built-in generator?
Also, the differences between Markdown and HTML files in this context (where you control 100% of what gets generated) are mostly nominal. read_yaml IIRC will actually read the front matter from both, so that shouldn't be an issue.
Asked this on superuser.com, not sure if stackoverflow is a better suitable place for it, but I am not getting any answers yet:
===
I am trying to generate a new blog entry in my octopress setup, but I noticed that some previous posts are being generated as empty files in public, so are the new ones I am trying to generte.
There seems to be no difference at all between the markup files from one entry which is being properly generated to another that isn't
I've got two octopress installations, one's working and this one I am talking about isn't, updates octopress on both, reinstalled bundle but no luck, files as atom.xml are also not being generated correctly.
Also updated from ruby 1.9.2p290 to latest release from 1.9.3 but also did not difference.
Anyone's encountered this before?
===
This is most likely because you started using codeblocks. This was happening to me, and even posts/pages that didn't use codeblocks would fail to generate. My problem (on Windows) was that I didn't even have Python installed (thought I did). Installing it fixed the problem, then gave me another error, which was fixed by updating the pygments.rb (note .rb) gem. Doing these two things fixed all my problems.
There's a similar issue if you're on arch linux which defaults python to version 3 which isn't supported by pygments.rb yet. You'll have to look around to figure out how to fix that to use 2.7 instead, but it should be pretty straightforward.
Can you provide an example of: a) a post that doesn't generate correctly, and b) a post that does generate correctly?
I assume they are just individual posts (and not, for example, pages like /about/). I would also assume that they render as blank both in the blog index on your front page and on the individual post page.
Also - what does render? Is it rendering the rest of the page, but just without the "content" of the post itself? Or does the page not even exist? (404?)
I have seen many questions and differing answers on using the jQuery plugins in the Rails 3.1 asset pipeline, which leads me to believe that this is new enough that it isn't settled science. I have tried using my jQuery plugins in the pipeline, but ran into issues when it came to incorporating the plugin stylesheets.
Now I am trying to back out of that solution, and only put my jQuery plugins and their associated themes and stylesheets in the traditional locations under "public". So, a sort of mixed solution. Then I put the tags back in my layout file to reference these directly.
Of course, now my problem is that Rails only knows to use the asset pipeline, and it's looking in "/assets" for them. They ain't there no more though.
Is there a right way to do this? I don't want to modify these plugins at all, so no changing of the stylesheets or anything else, I want them to just work at this point. Barring a correct way to use jQuery plugins in the Rails 3.1 asset pipeline, is there a way to make Rails use the traditional paths in addition to /assets?
I'm using a tiny gem sprockets-urlrewriter. Citing the readme:
Rewrites relative CSS urls to absolute ones, which means that you can include, for example jQuery UI, without any modifications into the asset pipeline.
So you can put the files in their respective directories and the gem will care about the asset pipeline.