Comments (9)
The current templating mechanism is quite weak and cannot really do that. At the moment, the idea is that a template is just something (fairly static) that you can put around a single *.fsx or *.md file.
I also find this a bit limiting - I played with reimplementing Jekyll style templating (to have F# runner for fsfoundation - see here) and I wrote a more complex processing for FunScript (see here).
I do not think there is easy way to get what you suggest (I think there is no overload that returns the file as a string - this would make it easier). If you can submit a pull request that adds this (overloads returning a string & an API like your BuildHTML
) that would be cool!
from fsharp.formatting.
I maybe way off here, but it feels like RazorEngine could be a solution to this problem. You could then do something like,
<html>
<body>
<div id="main">
@Html.Raw(m => m.["main"])
</div>
<div id="left">
@Html.Raw(m => m.["left"])
</div>
.......
<body>
</html>
So essentially you could parse and transform the *.fsx
*.md
files as you currently do, bind the resulting strings into a dictionary and then use the razor engine to actually handle the template side of things.
I meant to have ago at this a couple of weeks back but with a newborn my time is somewhat limited. I guess the other problem is cross-platform support, I have never tried to run razor engine on mono.
Cheers
Colin
from fsharp.formatting.
@colinbull, Thanks. Interesting idea.
It looks like RazorEngine works on Mono - see this.
from fsharp.formatting.
I think tilde project has done some work in combining FSharp.Formatting and RazorEngine. It would be nice to contribute and improve the project further.
from fsharp.formatting.
Tilde - is exactly what I was talking about.. :).
On Thu, Jul 11, 2013 at 8:26 AM, Anh-Dung Phan [email protected]:
I think tilde https://github.com/aktowns/tilde project has done some
work in combining FSharp.Formatting and RazorEngine. It would be nice to
contribute and improve the project further.—
Reply to this email directly or view it on GitHubhttps://github.com//issues/18#issuecomment-20794623
.
from fsharp.formatting.
Yes, tilde looks very interesting (cc @aktowns)!
I did not have much time to play with it, but I certainly think that could be much better way to do more complex templating based on F# Formatting. (When I have a bit of time, I'll try to use it for my blog..)
from fsharp.formatting.
Wow, glad to see so much interest!
tilde is quite messy (a late night hack), i've attempted to copy jekyll's site folder structure (_posts etc) and templating as much as possible (within reason).
hoping to get more time to work on it (and learn more F#/.Net!), would love to know how you go with it
from fsharp.formatting.
Mustache would also be a good fit here.
from fsharp.formatting.
For those interested in follow up, I'm using F# Formatting & RazorEngine (with some parts of Tilde) in the new version of my blog: https://github.com/tpetricek/TomaspNet.Website I think this is trying to do some of the things discussed here.
from fsharp.formatting.
Related Issues (20)
- Need to update repo's nuget API key HOT 2
- Package references cannot be resolved when trying to build API documentation programmatically HOT 4
- Modernize the default theme HOT 37
- Some displayed examples may have broken indendation HOT 11
- Add how-to for the most typical scenario HOT 2
- List users of this tool HOT 1
- CSharp library not used for generating API docs HOT 7
- Function signature tooltips include attributes for arguments that make the tooltip unreadable HOT 5
- Directory.Build.props is ignored if there are no projects or solutions HOT 3
- SEO-optimization for new theme HOT 4
- Suggestion: init command
- Dark mode borders: too much contrast?
- Namespace description overflows content box
- Output font size on mobile safari is too big HOT 6
- Using testcontainers in a fsx script gives wrong output HOT 7
- Create a keyword/glossary site map
- add .dib notebook support HOT 6
- --watch expectation HOT 1
- Suggestion: auto-expansion of `<details>…</details>` for direct links HOT 12
- Can FSharp.Formatting support documenting programs? HOT 1
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.