Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 501 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Markdown to HTML: script compatible with WSH

#1
There's a Markdown-to-HTML converter at [Pagedown][1] project (JS script).
My question is: how can I adapt this JS script to WSH (Windows Script Host) usage? I need e.g. js script which can be called by WSH command line:

cscript.exe md_to_html.js c:\test\aa.md

I didn't find such page in google.
[1]:

[To see links please register here]

Reply

#2
Create WSF-file named **pagedown.wsf** with the following script

<!-- language: lang-html -->

<job>
<object id="Stream" progid="Adodb.Stream" /> <!-- utf-8 documents support -->
<script language="jscript" src="Markdown.Converter.js" />

<script language="jscript">
Stream.Charset = 'utf-8';
Stream.Open();
Stream.LoadFromFile(WScript.Arguments.Item(0));

var text = Stream.ReadText();

WSH.Echo(new Markdown.Converter().makeHtml(text))
</script>
</job>

and use it with **cscript.exe**

cscript //Nologo pagedown.wsf input.md > output.html

In case of troubles with ADODB try to download and install it from [here][1].


[1]:

[To see links please register here]

Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through