I agree with this ! However, here we are in a specific case and you have the correct final visual version for the format you are using.
As you choose output: github_document
, the final version is a Markdown document not a HTML document, so the final visual version is with markdown syntax.
There is a preview offered that opens in the IDE "asif" it was renderered on github. It won't be exactly the same as when previewed on Github (because Github has its own markdown renderer that will convert a .md
file using GFM syntax to a HTML view.
If you want to have the html preview locally, you can set keep_html = TRUE
for this format. That way the html file generated for preview won't be in a temp folder (default behavior) but save in the working directory.
If you use another output format (html_document, docx_document, pdf_document, ...), you'll have a final version that is the final format output.
Your question here is highly related to the use of github_document
format, which is a variant of md_document
which use GFM syntax. It is Markdown as input, and as output but not with the same markdown flavor.
Hope it helps understand.