Is there something similar to "maven site plugin (javadoc)" is available for node? To be more specific, we are looking for a node package which can covert .md files in a reactjs project into html files. By convention each folder of our project has a markdown file which holds detailed documentation. We are looking for a tool (cli) which we can fire during the build process to create a documentation folder in the build (destination directory)- specifically interested in static HTML generation.
Thanks,
San
What have you looked for so far? Just googling "node MD to HTML" gives plenty of potential modules like this one and this one.
Have you tried some and they haven't worked? What have you looked for?
Found https://react-styleguidist.js.org/docs/documenting.html for my project. Awesome tool (though it is not equivalent to Maven Site).
Related
I'm new to web development, recently I want to build my own blog. I use Next.js to host my pages, I have already got the skeleton done, but there are still some significant problems.
How to render pages from markdown file? I just don't know how others do this. Do I have to use fs in the 'server.js' file and respond to certain request by md file? Or there are other ways?
If step 1 was completed, I wonder if I have <img> tags in my markdown file which refer to some local pictures, how can I render those?
To answer 1. You can use the npm package markdown-to-jsx .
But I strongly recommend using Docusorous or GatsbyJS for this purpose. Both have your requirement inbuilt.
Secondly, for Images - You can always include them in Markdown and they will be converted to JSX using markdown-to-jsx .
I use npm as a package manager for my web frontend projects. I have a need to generate some fake data locally within JavaScript in a project. Faker.js seems to be the perfect library to do so.
Most libraries, when I install them with npm, either have usable js files at the root of the installed files or provide a dist or similar folder with the .js files that I can reference, e.g. <script src="node_modules/angular/angular.min.js"></script> Faker.js however does not include this.
The documentation for faker simply includes this line: <script src = "faker.js" type = "text/javascript"></script> Clearly this will not work since the package doesn't even install a file called faker.js anywhere. My assumption is that you're expected to either use it with Node.js (non web frontend) projects or you're expected to build it somehow to get the faker.js file.
One tutorial I found online says you can npm install faker and then use <script src="node_modules/faker/build/build/faker.js">. But I also do not have a build folder. The tutorial didn't give any instructions on building the faker.js file.
Can someone shed some light on how this works? I have actually seen at least one other package (jQuery) that is similar and does not include a compiled usable browser version in the distribution. In past projects I've simply downloaded a compiled .js file and included it in my source control, but I'd like to try to avoid that if at all possible!
(Please don't answer with "just use a CDN" - I am working in an environment with specific policy requirements that HTML on the production server may not directly reference any off-site assets or scripts, but it is OK to pull in those libraries and self-host them. Frustrating, yes, but I don't get to make the rules.)
Environment:
VS2015 with cordova tools.
Win8.1.
Practise project is WinJS ToDo sample app from web.
Maybe this is just SUE (Stupid User Error) but when I'm adding barcodereader plugin (config editor ui -> using git address) all goes fine and new plugin comes to plugin folder in project tree.
Problem is that I can't seem to find way to use that new plugin at all. I can add <script src=""> tag for plugin's .js-file and it compiles, but when I try actually do something with plugin from code, it isn't recognized at all.
My new love with VS is suffering now...
The problem is that you need a definition for the plugin in order to consume it in a TypeScript project. The usual place to find definitions (commonly defined in d.ts files) is on www.definitelytyped.org. However in this case, the plugin author probably has not defined a TypeScript definition so you won't find it there.
That means you'll need to write one yourself. Think of a d.ts file like a header file in c++. It defines the interfaces and contracts in the library you're consuming. It's really not too hard to write these once you've learned how to do it. Here's one link that might be useful:
https://typescript.codeplex.com/wikipage?title=Writing%20Definition%20%28.d.ts%29%20Files
Hope that helps.
I'd like to build a plugin for Brunch but I don't know where to start. The Brunch plugin API documentation is the closest I've found to a How-To guide but I don't know enough to make use of it. Ideally I'd like a detailed tutorial that walks me though from the beginning but I can't find anything on Google. Does anyone have tips for building a Brunch plugin?
As noted in your question and the comments the Brunch plugin API documentation and source code of existing similar plugins are the best references for working on creating a new one.
For what you're trying to do static-jade-brunch would be a good example to start off with.
I'm using markdown and reveal.js to create presentations, and want to start using node.js to serve them from my website.
I've read the docs for reveal.js and it seems like it's easy to do for one presentation, but trickier for several. For example, I'd like
http://mysite/presentations/rabbits
and
http://mysite/presentations/deer
to run on the same instance of node, but each point to a different presetation. Is this possible natively (or with existing plugins), or will I have to hack something together myself?
I know, just three years late. But in case anyone might end up here to look for an answer, there's a working recipe over here: https://web.archive.org/web/20151223044405/https://medium.com/#KienanKB/serving-multiple-reveal-js-presentations-b1a5c086e959 (archived link to the now removed article).
Note: Reveal.js changed the part defining what files it watches:
html: {
files: [ ‘index.html’ ]
}
Instead of ‘index.html’ it now reads ‘*.html’.
The recipe still works fine though.
As long as you're using basic features you don't need node.js at all - just drop the reveal.js distribution in every presentation folder where it is served statically.
Another option is hosting on github pages, I've checked it now for this scenario and it seems to be served right.
You might also want to raise this issue at the project page https://github.com/hakimel/reveal.js/issues