Comments (2)
Hi,
having a way to generate PDF output from the document would be great. I quite like the LaTeX option (this would be nice for people like me who occasionally want to include some F# code in academic publications, which often require LaTeX).
As for the packages used, the pdfcomment looks quite nice (but I agree that tooltips do not make that much sense in PDF). The listings package seems to take care of the colouring itself (the text in the document is just plain text). I suppose that if you want to generate LaTeX, you would generate code with all the formatting (based on the AST, just like when generating HTML), so I do not see how this would work (but definitely, give it a try! I'm a LaTeX beginner :-)).
It might be worth checking out how lhs2TeX works - which is a similar tool for Haskell.
Thanks for your interest in doing this! Having PDF output would be really great!
from fsharp.formatting.
I finally have some time to work on a pull request.
I abandon tooltips completely because we don't need them in PDFs.
Regarding source code highlighting, I narrow to choose one in three packages: fancyvrb, minted and listings.
- fancyvrb: pros - easy to customize with commands; cons - hard to set background color and word wrapping.
- minted: pros - extending fancyvrb with advanced options; cons - hard to set up and having external dependencies (Python, etc).
- listings: pros - supporting background color and word wrapping; cons - hard to extend the current setting.
Right now I implement fancyvrb to colorize F# source code and listings to format other languages. I tried to extend listings in the same way I did with fancyvrb but failed. Otherwise, using only listings is the preferred option.
When writing conversion from Markdown to LaTeX, I notice HtmlBlock
. LaTeX doesn't support inline HTML, so I escape those strings and display them as is. In the future, we may need to parse HTML and convert to LaTEX.
And the fact that we format snippets as HtmlBlock
before displaying is confusing since it is not the only way the snippets should be processed.
I took a look at lhs2TeX
. We can generate beautiful type-set source code with math symbols like them if we handle Markdown math extensions. One might have to annotate to recognize which bits need to be type-set. I'm just toying the idea with template-math.tex
template.
Please take a look at the #14 issue.
from fsharp.formatting.
Related Issues (20)
- Make a better attempt at finding intended member for <seealso> HOT 3
- Use `Microsoft.Build.Locator` and stop bundling MSBuild assemblies in the CLI tool. HOT 2
- Support generating documentation from specific assemblies in the CLI tool. HOT 2
- `--projects` does not work with relative paths. HOT 1
- String Links 404 HOT 15
- Async function takes longer than usual HOT 5
- Consider targetting .NET 6 as well HOT 8
- Better "Tests" detection HOT 10
- _menu-item_template _menu_template oddities HOT 2
- Guidance on literate programming HOT 9
- Missing `fsdocs-page-source` in ApiDocs generation HOT 2
- Using polyglot notebooks (dotnet interactive) as input HOT 13
- fsdocs does not generate correct code cell metadata for .ipynb
- Cannot use the evaluator from .net7 scripts
- Use fsdocs command line tool to convert single files
- Get CommonMark 0.30 tests to pass for "Tabs" section
- Get CommonMark 0.30 tests to pass for "Fenced code blocks" section
- Dockerfile fails to build with "failed to solve: process /bin/bash ..." HOT 2
- discussion: multi target F# libraries (IL, WebSharper, Fable, etc.)
- discussion: offering back links form API pages to the other documentation pages?
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 fsharp.formatting.