Add an optional settings argument to render calls

Summary:
Add the ability to pass in options to the render calls which contain information about the parse. This information is passed around to the parser and builder, which parse and render differently depending on the options. Currently, this includes an option to render the math in display mode (i.e. centered, block level, and in displaystyle).

Also added some changes to make it easier to add new data to functions (now that new data doesn't need to be copied into the ParseFuncOrArg data structure, it is looked up when it is needed) and has more sane support for the `'original'` argType (as suggested by pull request #93).

Test Plan:
 - Make sure tests and lint pass
 - Make sure huxley screenshots didn't change, and new screenshot looks correct

Reviewers: alpert

Reviewed By: alpert

Differential Revision: https://phabricator.khanacademy.org/D13810
This commit is contained in:
Emily Eisenberg
2015-02-19 15:26:57 -08:00
parent d61a04c80d
commit fd18f6979e
14 changed files with 190 additions and 144 deletions

View File

@@ -1,5 +1,15 @@
@import "fonts.less";
.katex-display {
display: block;
margin: 1em 0;
text-align: center;
> .katex {
display: inline-block;
}
}
.katex {
font: normal 1.21em KaTeX_Main;
line-height: 1.2;