question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Use HTML tags in YAML

See original GitHub issue

Heyho and thanks for this great piece of software. Makes a lot of fun to work with. One Question . Is it somehow possible to use html markup in our yaml files like so:

text: new module
context:
      fieldLabel: |
                   <strong>
                       Some Bold Text
                   </strong> and now normal continued.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
iamkeircommented, Jul 14, 2017

@tonimain You can 😃

title: My Module
context:
  someHTML: <p>Yehaw!</p>

Then use three curly braces to disable HTML escaping:

{{{ someHTML }}}

See: http://handlebarsjs.com/expressions.html

1reaction
samuellscommented, Jul 21, 2017

I’ve created js helper/parser for it kind of. I’ve used as advantage, that you can create component config file as .js. But we didn’t want to switch configs into js - so we have a special cases, where we have config.yml and config.js. Than I just use js module to load yml settings and inject the content from specific html.

Sample - breadcrumb.config.yml

title: Breadcrumb Navigation
status: 'wip'
preview: '@preview'
context:
  breadcrumbs: ''

Sample - breadcrumb.config.js

const configHelper = require('fractal-config-helper');
const configObject = configHelper.loadYml(__filename);
configObject.context.breadcrumbs = configHelper.sampleLoader('_breadcrumb.html');
// Export config
module.exports = configObject;

in fractal-config-helper are defined few helper functions, which I can use to load config.yml content according to the folder into the configObject and after that I can inject content of html file also into this configObject. In this case it’s static definition of html, but you could build the html variable same as __filename.

Than you have to export configObject - this is from fractal documentation. And config.js has higher priority as config.yml

Read more comments on GitHub >

github_iconTop Results From Across the Web

Add style to elements in HTML tags in YAML file - Stack Overflow
My requirement is to create tooltip inside a YAML file which will be linked to their respective fields in a react-form.
Read more >
Adding HTML tags to a blueprint YAML file - Solved - Kirby forum
Is there a simple way to add HTML tags to my YAML file? I am trying to edit the appearence of returned values...
Read more >
YAML tutorial in the context of Jekyll - Idratherbewriting.com
YAML (“YAML Ain't Markup Language”) doesn't use markup tags. · Because YAML does use white space for the structure, YAML is extremely picky...
Read more >
4.1 YAML options | bookdown: Authoring Books and Technical ...
A guide to authoring books with R Markdown, including how to generate figures and tables, and insert cross-references, citations, HTML widgets, ...
Read more >
Best HTML to YAML Converter Online tool - Code Beautify
What can you do with HTML to YAML? · This tool helps you to get plain yaml from html table very quickly without...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found