I'm writing my CV in MMD. I'd like to add a link to my website, twitter account etc in the mmd metadata and then reference that in the pdf, html, latex that is generated from the mmd. Here's an example mmd file.
---
Name: Mark Ruddy
Website: [myWebsite](http://myWebsite)
Street: my address here
City: myCity
Postcode: xx xxx
Phone: Tel: 0777777777
Email: email: me#myaddress.me
Twitter: Twitter: [#mytwitter](http://twitter...)
Date: March 2, 2015
# Title
[%name]
[%Street]
[%city]
[%postcode]
[%phone]
[%email]
[%website]
[%twitter]
I'm trialling this using Marked2 as my mmd parser. When I parse the mmd [%website] appears as [myWebsite](http://myWebsite) not myWebsite.
I'm pulling my hair out to find a solution. I guess it's simple but...
Any help appreciated
thanks
The documentation specifically states:
Metadata is processed as plain text, so it should not include MultiMarkdown markup. It is possible to create customized XSLT files that apply certain processing to the metadata value, but this is not the default behavior.
I recall in one project of mine, I wanted the meta-data to include a Summary which consisted of Markdown. I had to run the document through the Markdown parser. Then I had to get the "summary" key from the meta-data and run that through the Markdown parser separately. I then needed to pass each item separately to my templates for display. I suspect you may need to do something similar to meet your needs.
Related
After reading the online Pandoc manual and browsing pages such as knitr-pandoc-article-template-supporting-keywords and Keywords in Pandoc 2, I haven't figured out yet how to write the values of the thanks and keywords YAML fields from the header of a Markdown file to a docx document through Pandoc conversion. My working version of Pandoc is 2.18.
I have thought that a Lua filter might be the way to proceed, but my knowledge of both Lua and the Pandoc framework at the programmatic level is quite limited.
Any help in this regard would be greatly appreciated.
Although my actual setup is more complex, the following Markdown lines with a YAML header should do for an MWE:
---
title: The Title
author: The Author
thanks: |
The author wishes to thank certain support.
abstract: |
This is the abstract.
keywords: [one, two, three, four]
---
# A Heading
Text body.
The answer to this depends a little on how you'd want the thanks to be viewed. E.g., if you'd like it to be presented as a footnote to the author, you'd use a Lua filter like this:
function Meta (meta)
meta.author = meta.author .. {pandoc.Note(meta.thanks)}
return meta
end
The approach can be adapted to match different requirements.
I would like to use R Markdown to produce a document that takes advantage of certain LaTeX packages. Sometimes, I want to render the Rmd document to PDF. At other times, I want to render it to HTML.
I would like to load packages via the extra_dependencies option, rather than through the includes or header-includes options. Some of the LaTeX packages should be loaded with options. Others shouldn't be.
When I render the Rmd document to PDF, there is no problem. But when I try to render the same document to HTML, rmarkdown::render chokes on the processing of the extra_dependencies argument. (I am using rmarkdown 2.1.) Here is a minimal example, following the style of the R Markdown Cookbook:
---
title: "Test Processing of YAML Header in R Markdown Document"
output:
html_document:
extra_dependencies:
array: null
numprint: ["autolanguage"]
---
Hello.
Rendering that document with rmarkdown::render generates a dependency_resolver -> <Anonymous> -> sapply -> lapply error. If I add dashes before array and numprint, the error is instead Error: invalid version specification 'NULL'. But if I just change html_document to pdf_document, there is no problem.
How may I generate an HTML document while loading packages through the extra_dependencies option? And why does this example work when I generate PDF documents, but not when I generate HTML documents?
Note, the extra_dependencies argument is available for multiple different output formats (PDF, HTML), but these settings are output format specific.
If you want to assign LaTeX packages, these will will only work as an extra_dependency for PDF outputs. This is causing the error as it doesn't recognise the syntax of the extra dependency. To get your code to work you need to provide separate options for HTML and PDF:
---
title: "Test Processing of YAML Header in R Markdown Document"
output:
html_document: default
pdf_document:
extra_dependencies:
array: null
numprint: ["autolanguage"]
---
Hello.
You could specify extra dependencies for an HTML document, but these will have to be HTML dependencies, not LaTeX packages. There don't seem to be many great examples showcasing this, as this functionality is mostly used by templates and rarely exposed to end users, but it would allow you to load additional JavaScript dependencies. This example is given here: https://github.com/rstudio/rmarkdown/issues/1654
I donĀ“t knwo why this error occurs, but I have a workaround. Instead of using extra_dependencies you can use header_includes.
---
title: "Test Processing of YAML Header in R Markdown Document"
output:
html_document
header-includes:
- \usepackage{array}
- \usepackage{numprint}["autolanguage"]
---
I have task to export Activities including 'Descriptions' filed which contains HTML of the stored email treads. I have to export this field/column as parsed text (not HTML codes, only a real content of the mails).
Actually, when Activities listing is displayed in web, Descriptions column displays exactly what I need, but when I export it to excel, this columns displays HTML codes (and is limited to 1044 chars, so there is no any real body content).
Please, give some advice or link where I can learn how to export this field as it looks in web.
Thanks.
Unfortunately, plain text email body is not stored automatically by OOB CRM. All you have is Rich text stored description field.
There are multiple different solutions to strip the HTML tags & store the plain text in a different field viz code solution, no-code configuration solution using third party like North52, etc.
If you have developers in your team, then C# Plugin would be the best bet to strip & store on creation of Email record itself.
Would a Report Wizard report work to give you the results you need?
Also, Arun's answer was marked as correct (as it should be...) My only advice would be to store the email body without the HTML tags in a different field. I've found that stripped HTML tags can do funny things to formatting.
One of my web pages needs to include rows of items (image, title, description). The description must accept markdown. I haven't found any way to do this in Jekyll without plugins or creating multiple files, one for each item.
Another requirement is that the site be built by Github Pages. ie: no Jekyll plugins, Redcarpet markdown.
Ideally, I would have liked to create a Jekyll data file (_data/products.yml) which contains a structure similar to below. Note that Description contains markdown list and formatting.
- Name: Company A
Year: 2005
Description: >
I was responsible for the following:
- Review of contracts
- Hiring
- Accounting
- Name: Company B
Year: 2010
Description: >
My role included **supervising** the marketing team and leading **publicity**.
Another option I saw was to use Front-matter with the above info. It is slightly more cumbersome since it ties the data with a particular page (eg: work-experience.md).
I've tried various variations on the above but the formatting is never transformed into HTML. How can this be handled?
If you do not wish to use Plugins, I believe the best bet is to have it in _data although not sure if it would be valid YAML or even a valid YAML is a requirement for _data content.
Have you tried using markdownify function such as
{{ site.data.products.description | markdownify }}
http://jekyllrb.com/docs/templates/
So for my text parsing in C# question, I got directed at YAML. I'm hitting a wall with this library I was recommended, so this is a quickie.
heading:
name: A name
taco: Yes
age: 32
heading:
name: Another name
taco: No
age: 27
And so on. Is that valid?
Partially. YAML supports the notion of multiple consecutive "documents". If this is what you are trying to do here, then yes, it is correct - you have two documents (or document fragments). To make it more explicit, you should separate them with three dashes, like this:
---
heading:
name: A name
taco: Yes
age: 32
---
heading:
name: Another name
taco: No
age: 27
On the other hand if you wish to make them part of the same document (so that deserializing them would result in a list with two elements), you should write it like the following. Take extra care with the indentation level:
- heading:
name: A name
taco: Yes
age: 32
- heading:
name: Another name
taco: No
age: 27
In general YAML is concise and human readable / editable, but not really human writable, so you should always use libraries to generate it. Also, take care that there exists some breaking changes between different versions of YAML, which can bite you if you are using libraries in different languages which conform to different versions of the standard.
Well, it appears YAML is gone out the window then. I want something both human writable and readable. Plus, this C# implementation...I have no idea if it's working or not, the documentation consists of a few one line code examples. It barfs on their own YAML files, and is an old student project. The only other C# YAML parser I've found uses the MS-PL which I'm not really comfortable using.
I might just end up rolling my own format. Best practices be damned, all I want to do is associate a key with a value.
Try this(Online YAML parser).
You don't have to download anything or do something. Just go there, and copy & paste. That's it.
There appears to be a YAML validator called Kwalify which should give you the answer. You shoulda just gone with the String tokenizing, man. Writing parsers is fun :)
There is another YAML library for .NET which is under development. Right now it supports reading YAML streams. It has been tested on Windows and Mono. Write support is currently being implemented.
CodeProject has one at:
http://www.codeproject.com/KB/recipes/yamlparser.aspx
I haven't tried it too much, but it's worth a look.
You can see the output in the online yaml parser :
http://yaml-online-parser.appspot.com/?yaml=heading%3A%0D%0A+name%3A+A+name%0D%0A+taco%3A+Yes%0D%0A+age%3A+32%0D%0A%0D%0Aheading%3A%0D%0A+name%3A+Another+name%0D%0A+taco%3A+No%0D%0A+age%3A+27%0D%0A&type=json
As you can see, there is only one heading node created.
Just to make an explicit comment about it: You have a duplicate mapping key issue. A YAML processor will resolve this as a !!map, which prohibits duplicate keys. Not all processors enforce this constraint, though, so you might get an incorrect result if you pass an incorrect YAML stream to a processor.