Comments (8)
I posted this in the gitter, but no one responded yet: How would I set the directive(s) in the webpack loader?
from posthtml.
@trisys3 Hi, thanks for the feedback and I'm sorry that I didn't notice your message in gitter. I will try to sort out your question as soon as possible.
With a cursory reading of your problem, as far as I was able to understand you are experiencing problems using directives from PHP. They should work because tests are passed on them.
Perhaps you did not explicitly specify the type of directive you are using in the options
import posthtml from 'posthtml'
const php = `
<component>
<title><?php echo $title; ?></title>
<text><?php echo $article; ?></text>
</component>
`
const result = posthtml()
.use(require('posthtml-custom-elements')())
.process(html, {
directives: [
{ name: '?php', start: '<', end: '>' }
]
})
.html
console.log(result)
from posthtml.
That's fine, you were a lot faster than most issue answerers I've worked with. I haven't used gitter actually, is that the way you like to communicate on this repo?
I don't see directives
as an option for posthtml.process
. According to the API page for PostHTML, there are 4 options: sync
, parser
, render
& skipParse
. What does directives
do, and where is it documented?
from posthtml.
I found the docs for directives
, under the repo for parser. I didn't see any place that mentioned these options are used in the process
function.
The directives
option is a little confusing, too. Does this actually make the parser ignore the directive? What does the parser do otherwise, with directives that aren't ignored?
If this is what I'm meant to do, then I guess I'll close the issue, though I still think the docs are a bit confusing.
from posthtml.
I found the docs for
directives
, under the repo for parser. I didn't see any place that mentioned these options are used in theprocess
function.
https://posthtml.org/#/usage?id=api / https://github.com/posthtml/posthtml#api
under the description about async
The directives option is a little confusing, too. Does this actually make the parser ignore the directive?
yes
What does the parser do otherwise, with directives that aren't ignored?
Attempts to parse them, the parser should not know about third-party directives unless explicitly specified in the options
from posthtml.
I posted this in the gitter, but no one responded yet:
Hi, github is now the preferred and faster way to communicate.
How would I set the directive(s) in the webpack loader?
Apparently this functionality is not implemented in posthtml-loader
from posthtml.
That was fast, less than 2 weeks ago you recommended using gitter, in this same issue no less.
I noticed you opened another issue on posthtml-loader
, thanks. I'm sure you already saw this, but I added a comment with more details about what I'm trying to do.
from posthtml.
That was fast, less than 2 weeks ago you recommended using gitter, in this same issue no less.
Yes, I try to quickly adapt to the situation and I see that I won't be able to pull another messenger and it's not effective for me. So I came to the conclusion that github is a convenient way for me to understand and solve the problem and everything in one place)
I noticed you opened another issue on posthtml-loader, thanks. I'm sure you already saw this, but I added a comment with more details about what I'm trying to do.
Thank you, it was important for the prompt solution of the problem
from posthtml.
Related Issues (20)
- Inlined SVG rewritten and broken HOT 3
- Patreon HOT 1
- [perf]: add TypeScript typings HOT 3
- Not super clear when a return value is necessary, and when modifying a value by reference works.
- Add possibility to include plugins using ternary operator HOT 10
- addDependencyTo causes htmlnano config not working HOT 1
- tree not walking into child nodes HOT 2
- Use jsdom? HOT 1
- will be good to add example with `async/await` HOT 7
- Dropping support for older NodeJs versions in a patch release breaks builds. HOT 1
- TypeScript bindings don't work as expected HOT 1
- Google Apps Script templating syntax gets stripped HOT 2
- [Feature Request] Allow plugin to modify posthtml configuration through a setter HOT 25
- Please consider to make a postcss-htmlhint plugin HOT 2
- TOC content without possibility to scroll HOT 2
- typescript type error HOT 3
- Null or empty character is not allowed as return type HOT 3
- bug: auto add p tag HOT 1
- readme.md Twitter icon missing
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 posthtml.