forked from liferay/liferay-docs
-
Notifications
You must be signed in to change notification settings - Fork 4
/
convert.bat
31 lines (21 loc) · 1 KB
/
convert.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
@echo off
set CLASSPATH=%~dp0\..\lib
if "%1"=="" goto usage
if "%2"=="" goto convert
java -cp .;%CLASSPATH%\* com.liferay.knowledge.base.markdown.converter.cli.MarkdownConverterCLI %1 > %2
goto end
:usage
echo Usage: convert.bat [Markdown file to convert] or convert.bat [Markdown file to convert] [HTML file to be written]
echo.
echo Run the convert.bat script from any directory.
echo.
echo The first argument is the path to the Markdown file to convert to HTML.
echo.
echo The second argument is optional. It specifies the path to the HTML file to be created. If this argument is omitted, the HTML file to be created will be created in the same directory as the Markdown file and will have the same filename as the Markdown file except that the .markdown file extension will be replaced by the .html file extension.
echo.
goto end
:convert
set htmlFile=%1
set htmlFile=%htmlFile:markdown=html%
java -cp .;%CLASSPATH%\* com.liferay.knowledge.base.markdown.converter.cli.MarkdownConverterCLI %1 > %htmlFile%
:end