Comments (4)
Hi Sizwe,
Thanks for reaching out.
I'm unsure what you're trying to do exactly. Are you trying to produce an HTML response? Or physically read an HTML file from disk, and render it's contents?
from falco.
I'm trying to read html file from disk, modify and render the contents
from falco.
Thank you for the clarification!
The Falco view engine won't help you with this, since it's based on pure F# functions. To me, it sounds like you need a template engine like scriban, which will efficiently replace symbols found in string literals.
You can use the string you get from scriban, or another template engine with the Response.ofHtmlString
in order to render the HTML with Falco.
let htmlStringHandler : HttpHandler =
let html = "{html string from template engine}"
html
|> Response.ofHtmlString
For a complete example of how this works, checkout the scriban example in the sample projects directory.
from falco.
thanks, scriban sounds like exactly like what i need :). I'm closing the issue
from falco.
Related Issues (20)
- Docs: minor error in Falco.Markup docs
- Docs: minor error with Routing HOT 3
- Request: Update Tags/Releases feature for repository HOT 4
- falcoframework.com is down HOT 1
- Add CORS support to HostBuilder HOT 2
- Question: Elem.button - onClick? HOT 3
- Broken Link & Spelling for "function composition" HOT 1
- Unable to serialize DtResponse object.
- Errors in Tutorial? HOT 6
- Add dapper HOT 1
- Attr.cols missing from Markup module HOT 1
- Enable the `Discussions` page HOT 1
- MapJson doesn't work HOT 2
- Recommendation for a basic Dockerfile to build Falco - deploy on Fly HOT 3
- [Question] Response.debugRequest is not defined HOT 2
- dead link HOT 6
- Typo HOT 3
- Question: XSS vs CSRF HOT 1
- Falco 4 handler not responding correctly. HOT 3
- Docs: re-direct examples out of date HOT 2
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 falco.