1.0.0 • Published 7 years ago
outline-loader v1.0.0
Outline Loader
A Webpack loader that works with Outline to compile literate JavaScript.
Note that to use this loader requires that you have installed Outline, and it is available on your path. See the Outline documentation for installation instructions.
Installation
npm install --save-dev outline-loaderOptions
language: Passed to Outline's-lparameter, indicating the language tag to compile withstyle: Passed to Outline's-sparameter to override the automatically detected styleconfig: Passed to Outline's-cparameter to specify the path to theOutline.tomlfileentrypoint: Passed to Outline's-eparameter to choose a named entrypoint
Example usage:
index.js
import { myFunction } from './functions.js.tex';
myFunction(3); // => 5functions.js.tex
\documentclass[11pt,a4paper]{article}
\begin{document}
This module works like this:
\begin{code}
==> Define some functions.
==> Export the functions.
\end{code}
Our function \texttt{myFunction} is used to add two to any input.
\begin{code}[name=Define some functions]
function myFunction(input) {
return input + 2;
}
\end{code}
Now that all the functions are written, they must be exported.
\begin{code}[name=Export the functions]
export { myFunction };
\end{code}
\end{document}webpack.config.js
module.exports = {
entry: 'index.js',
module: {
rules: [
{ test: /\.js\.(tex|md|html|bird)$/, loader: 'outline-loader' },
],
},
};1.0.0
7 years ago