Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add include-it-raw literate command #624

Merged
merged 2 commits into from
Dec 21, 2020
Merged

Add include-it-raw literate command #624

merged 2 commits into from
Dec 21, 2020

Conversation

HLWeil
Copy link
Contributor

@HLWeil HLWeil commented Dec 20, 2020

This pull request addresses issue #611.

The idea is to have a way to include results of snippets not formatted as fsi output but just as plain text. This allows for formatting them as html, e.g. as charts, as can be seen here. In the example, this was done by using a custom evalutator, which is not feasible with the fsdocs tool.

Therefore I added a new literate command include-it-raw, which evaluates the snippet, but then inserts is as plain text. As a small example I used this to embed a html table from a jagged array:

IncludeItRaw

The code in the Evaluator.fs got a little bit messy, as strings are formatted surrounded by "s, which show up in the final document and might even hinder the correct html formatting. I remove them in the Evaluator.Format method but maybe you have a better place or idea?

@cartermp
Copy link
Contributor

@HLWeil
Copy link
Contributor Author

HLWeil commented Dec 21, 2020

Sure thing! Something like this?

Copy link
Contributor

@cartermp cartermp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this is a good addition. I take it this lets you also output the HTML string for a chart yes?

@cartermp
Copy link
Contributor

Will merge, as this is a good change that does what you're after here.

@cartermp cartermp merged commit 34814bf into fsprojects:master Dec 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ability to output a raw string from an FSI evalutation instead of having it wrapped in code blocks
2 participants