Github Markdown Formatting



Markdown formatting buttons for text inputs. Contribute to github/markdown-toolbar-element development by creating an account on GitHub. GitHub.com Enterprise Server 3.0 Enterprise Server 2.22 Enterprise Server 2.21 GitHub AE See all Enterprise releases Organizing information with tables You can build tables to organize information in comments, issues, pull requests, and wikis.

Source: R/github_document.R
Github Markdown Formatting

Format for converting from R Markdown to GitHub Flavored Markdown.

Arguments

toc

TRUE to include a table of contents in the output

toc_depth

Depth of headers to include in table of contents

number_sections

TRUE to number section headings

fig_width

Default width (in inches) for figures

fig_height

Default height (in inches) for figures

dev

Graphics device to use for figure output (defaults to png)

df_print

Method to be used for printing data frames. Valid valuesinclude 'default', 'kable', 'tibble', and 'paged'. The 'default' methoduses a corresponding S3 method of print, typicallyprint.data.frame. The 'kable' method uses theknitr::kable function. The 'tibble' method usesthe tibble package to print a summary of the data frame. The 'paged'method creates a paginated HTML table (note that this method is only validfor formats that produce HTML). In addition to the named methods you canalso pass an arbitrary function to be used for printing data frames. Youcan disable the df_print behavior entirely by setting the optionrmarkdown.df_print to FALSE. SeeDataframe printing section in bookdown book for examples.

includes

Named list of additional content to include within thedocument (typically created using the includes function).

md_extensions

Markdown extensions to be added or removed from thedefault definition or R Markdown. See the rmarkdown_format foradditional details.

hard_line_breaks

TRUE to generate markdown that uses a simplenewline to represent a line break (as opposed to two-spaces and a newline).

pandoc_args

Additional command line options to pass to pandoc

html_preview

TRUE to also generate an HTML file for the purpose oflocally previewing what the document will look like on GitHub.

keep_html

TRUE to keep the preview HTML file in the workingdirectory. Default is FALSE.

Value

R Markdown output format to pass to render

Details

Underline Markdown Github

See the onlinedocumentation for additional details on using the github_documentformat.

Maintaining a resume is one of those annoying tasks that always takes up much more time than it should. Compounding this is the fact that resumes are regularly requested in different formats: raw text, pdf, Microsoft Word, etc. In addition, it might be desirable to have a HTML version online somewhere for added visibility. How then to manage this complexity? No one wants to manually update four versions of their resume, and the pdf conversion tools included with word processors leave much to be desired.

Christophe-Marie Duquesne has a great blog post in which he shows that using the document translation tool pandoc, you can maintain your resume in markdown format and convert to other formats such as html and Word at will.

This is convenient because:

  • It means there is only one file you need to update to make any changes.
  • Markdown is designed to be human-readable, so if you need a raw text version of your resume, no transformation is needed.
  • Markdown has syntax for section headers, lists, tables and more, so you can add as much structure as you want to your resume.
  • Being a format designed (partly) for human consumption and creation, it is also an appropriate format to keep in version control.

This is what a simple resume in markdown format looks like:

However, in the above approach the generation of a pdf version (arguably the most important) is problematic. The suggestion is to use the wkhtmltopdf tool, which takes the pandoc-generated HTML and uses the webkit browser engine to generate a pdf. While this will preserve the look and feel of the resume, the pdf output is suboptimal, as webkit is not a typesetting engine. Most importantly, it does not handle page breaks well -- in some cases even putting a page break right across a line of text.

Markdown Github Reference

Github Markdown Formatting

On the other hand, TeX-based typesetting systems are designed for this task. Moreover, pandoc supports two types of TeX output: LaTeX and ConTeXt. I chose the latter since it seemed interesting, is more focused on page layout, and is not specifically geared towards scientific documents. Through trial and error, I was able to create a style.tex which comes close to emulating Christophe-Marie's style.css, resulting in a nicely typeset pdf resume which looks quite similar to the HTML:

Github Markdown Formatting

HTML version of the resume:

Github Readme.md Formatting Table

PDF version of the resume:

Github Markdown Format Json

The repository is here (pull requests welcome!), and it includes a Makefile, so the instructions to make your own resume are:

Github Markdown Formatting

You will need both pandoc and ConTeXt installed on your system, which on Debian and derivatives can be achieved with