![]() Then Ctrl + click on the url it gives you, to open the output in your browser. On a wide monitor, it takes up the whole width. grip doesn't have syntax highlighting for code blocks, greyed background for code, nor reasonable column widths for the output content. Just click the little m plugin icon in the top right of your Chrome browser to choose Markdown Viewer settings you want:Ĭontrast this to the output from grip, which I think doesn't look nearly as good. See the "GitHub" theme is selected here, for instance. Its output looks really nice, and is almost identical to GitHub's markdown output! Notice it has language-aware syntax highlighting for code blocks, nice-looking, greyed code backgrounds, and reasonable column widths for output content. The above markdown file produces this output directly in my Chrome browser when viewed with the Markdown Viewer plugin installed and on. If you'd like to set the text itself to left, center, or right, you can include the text inside the `` element as well, as regular HTML, like this: Align images left, right, or centered, with NO WORD WRAP: Here is a sample markdown file, which is a snippet from my example markdown demo file in my project here: â Free and Open Source Example Markdown file Markdown Viewer boasts the following features (emphasis added): It works really well, and looks surprisingly similar to GitHub markdown! Just open your markdown file in Chrome with this plugin installed and activated, then use the menus to print and save as a PDF right from Chrome. My preferred technique, because it looks so good, is to use the Markdown Viewer plugin in Chrome. I'm still looking for a command-line solution which produces results this high-quality, but: Vim, ps2pdf (provided by Ghostscript) and Source-highlight are all available via Cygwin. Source-highlight -s java -f html -i Hello.java -o Hello3.html -title "Happy Java with java2html :-)" -tab 3Īnd each outputting their own respective HTML file:įurther examples of Source-highlight usage can be found here ![]() Source-highlight -s java -f html -input Hello.java -output Hello2.html -doc A list of all languages supported by Source-highlight can be found here.Ī few example Source-highlight commands include: source-highlight -s java -f html -i Hello.java -o Hello1.html If you'd like instead to go the route of HTML or LaTeX, you could try Source-highlight instead. This will produce a PostScript file that can be converted to pdf using, for example, ps2pdf: ps2pdf /path/to/file.ps Or inside of vim: :hardcopy >/path/to/file.ps If you have vim, you can easily achieve syntax highlighting by running the following from a terminal: vim -c hardcopy -c quit /path/to/file.ps Unfortunately, there's no good way to convert Markdown directly to a PDF file with syntax highlighting. ![]() On Github, you can use this to specify syntax highlighting like so: ```ruby I haven't found a workaround so far, so I'm just using single quotes for now.As I stated in my comment, Github uses Linguist to provide syntax highlighting. Note: You must have a ` tag in your layout header/footer so that the plugin can inject the required assets.Īpparently October can't handle them, so they end up looking like this: theme_panel_position: 'bottom' There, if you want a blockquote, you have to do some fancy html like: The solution? OMIT the language code: ``` In GitHub, you can specify what language a code block is as follows: ```htmlÄ«ut if you do so with October, you'll get everything double-encoded: ![]() Instead, you have to explicitly name each anchor as so: In GitHub, you get anchors created automatically for each heading. Let me mark down for myself and you my fair reader what I've stumbled upon. Working on publishing my firs plugin on the OctoberCMS marketplace and unfortunately once again I find myself in dire need of comprehensive docs. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |