Comments (14)
You can run MIX_ENV=docs mix docs
(or just mix docs
?) in the nx
subfolder and you should be able to see results locally. :)
from nx.
This is the same as elixir-lang/ex_doc#1571.
In this specific example this manifests in two ways:
_
pairs being expanded to markdown italic\\
is escaped backslash and gets converted to\
from nx.
@ndrean, would you be able to take a look? Thank you!
from nx.
oh, indeed! I didn't looked at the Hexdocs. Time to dive into Hexdocs, Earmark and probably Mathjax.
from nx.
You can also find the configuration on nx/mix.exs
.
from nx.
@jonatanklosko Maybe a naive quick thought: Earmark produces an HTML string, doesn't it? If we just ask Earmark to leave whatever is between $ signs, and embed MathJax in the rendered document (like adding a <script src=cdn mathjax...>), couldn't it render math? I also saw a MathJax.typeset
from nx.
@ndrean we don't want Earmark to inject the script, that should be up to the user. But yeah, the proper solution is to make Earmark aware of $ and $$, so their contents are not interpreted as Markdown :)
from nx.
@jonatanklosko ah, I see you already inject Katex, somehow used the "mix": defp before_closing_body_tag(:html)
I don't understand/know the interactions between ex_docs, earmark, so I believe you have a better position to open an issue to earmark, if this is the potential response?
from nx.
We don't have another option to handle this that doesn't require changing Earmark? Make we can indent with four spaces and remove the wrapping pre tag accordingly?
from nx.
@josevalim we could support alternative syntax (like GitLab, elixir-lang/ex_doc#1571 (comment)), but that creates more friction for people to use it. IIRC we were leaning towards $
and $$
support in Earmark, because GitHub added support for it.
from nx.
So request on Earmark it is. We will most likely have to contribute it. What do we do with this guide meanwhile? Can we avoid using _
or \\
? Or should we keep it on GitHub and remove it from the docs?
from nx.
So request on Earmark it is. We will most likely have to contribute it. What do we do with this guide meanwhile? Can we avoid using
_
or\\
? Or should we keep it on GitHub and remove it from the docs?
\\
is used for linebreaks, so I think it's rather unavoidable. _
could maybe be substituted by ^
if we changed subscripts to superscripts
from nx.
When you look at the Nx guide - for example, https://hexdocs.pm/nx/intro-to-nx.html#broadcasts- you see that Latex is parsed correctly with $$ and \begin. The problem starts when you have nested commands (\begin{matrix} \begin{matrix}...)., so it might not be straightforward.
I would remove this one from the hexdocs for the moment, just keep the Livebook and a link to the Github.
from nx.
Done for now. The core issue is currently trackled on ExDoc. Thanks!
from nx.
Related Issues (20)
- Convert Nx.LinAlg.qr to optional callback HOT 1
- Convert Nx.LinAlg.cholesky to optional callback
- Fix sign of zero values in Nx.ceil and Nx.conjugate HOT 1
- Add executable-level caching to Nx.Defn in EXLA HOT 1
- Nx.LinAlg.solve/2 with Nx.BinaryBackend returns tensor with wrong state HOT 6
- Nx.all_close not working with EXLA HOT 13
- How to Set XLA log level?? HOT 2
- could not compile dependency :exla HOT 3
- Implement Nx.stack as a default callback HOT 1
- Expand docs for the :axes option in Nx.gather/3 HOT 2
- Remove xla compiler_mode
- Use regions when compiling `if` in MLIR HOT 1
- Quantization via MLIR
- Special node acceleration via metadata HOT 6
- Import and export of MLIR modules
- function Torchx.__jit__/5 is undefined or private HOT 2
- Geometric / Clifford algebra in arbitrary dimensions HOT 4
- Automatically track which variables are inside if/cond/while
- Data Loaders in Nx? HOT 6
- Cannot transform dummy columns to Nx Tensors via Nx.stack HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nx.