-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
849e2da
commit cafbc9b
Showing
6 changed files
with
200 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,7 @@ docs | |
config/local.ts | ||
.DS_Store | ||
.idea | ||
|
||
# github pages | ||
_site/ | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/bin/bash | ||
|
||
# Check for correct number of arguments | ||
if [ "$#" -ne 2 ]; then | ||
echo "Usage: $0 <input_dir> <output_dir>" | ||
exit 1 | ||
fi | ||
|
||
# Set input and output directories from command-line arguments | ||
INPUT_DIR="$1" | ||
OUTPUT_DIR="$2" | ||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
# Set input and output directories | ||
CSS_FILE="$SCRIPT_DIR/style.css" | ||
TEMPLATE_HTML="$SCRIPT_DIR/template.html" | ||
INDEX_MD="$INPUT_DIR/index.md" | ||
|
||
|
||
# Ensure the output directory exists | ||
mkdir -p "$OUTPUT_DIR" | ||
|
||
# Check if the CSS file exists | ||
if [ ! -f "$CSS_FILE" ]; then | ||
echo "Error: CSS file '$CSS_FILE' not found!" | ||
exit 1 | ||
fi | ||
|
||
# Check if the template html file exists | ||
if [ ! -f "$TEMPLATE_HTML" ]; then | ||
echo "Error: Template file '$TEMPLATE_HTML' not found!" | ||
exit 1 | ||
fi | ||
|
||
# Create an index.md file | ||
echo "# VeBetterDao Contracts" > "$INDEX_MD" | ||
echo "" >> "$INDEX_MD" | ||
for file in ./docs/*.md; do | ||
base_name="$(basename "${file%.md}")" | ||
echo "- [${base_name}](./${base_name}.html)" >> "$INDEX_MD" | ||
done | ||
|
||
# Loop through all Markdown files in the input directory | ||
for file in "$INPUT_DIR"/*.md; do | ||
# Extract the base filename (e.g., "file.md" -> "file.html") | ||
output_file="$OUTPUT_DIR/$(basename "${file%.md}.html")" | ||
|
||
# Convert the Markdown file to HTML with a Table of Contents | ||
pandoc "$file" -o "$output_file" --toc --toc-depth=3 --css="$CSS_FILE" --standalone --template="$TEMPLATE_HTML" | ||
|
||
# Print the file being processed | ||
echo "Converted: $file -> $output_file" | ||
done | ||
|
||
|
||
|
||
|
||
echo "All files converted! HTML files are in $OUTPUT_DIR." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
body { | ||
font-family: 'Inter', sans-serif; | ||
line-height: 1.6; | ||
margin: 20px; | ||
} | ||
|
||
h1, h2, h3 { | ||
color: #333; | ||
} | ||
|
||
#TOC { | ||
background: #f9f9f9; | ||
border: 1px solid #ddd; | ||
padding: 10px; | ||
margin-bottom: 20px; | ||
} | ||
|
||
#TOC ul { | ||
list-style: none; | ||
padding-left: 15px; | ||
} | ||
|
||
#TOC a { | ||
text-decoration: none; | ||
color: #007BFF; | ||
} | ||
|
||
#TOC a:hover { | ||
text-decoration: underline; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<!DOCTYPE html> | ||
<html $if(lang)$ lang="$lang$" $endif$ dir="ltr"> | ||
|
||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"> | ||
<title>$if(title)$$title$$endif$</title> | ||
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon"> | ||
<link rel="apple-touch-icon-precomposed" href="images/apple-touch-icon.png"> | ||
|
||
$if(template_css)$ | ||
<link rel="stylesheet" href="$template_css$"> | ||
$else$ | ||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/uikit/2.26.4/css/uikit.gradient.css"> | ||
$endif$ | ||
|
||
<!-- <link rel="stylesheet" href="style.css"> --> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/diversen/pandoc-uikit@master/style.css"> | ||
<link href="https://vjs.zencdn.net/5.4.4/video-js.css" rel="stylesheet" /> | ||
<script src="https://code.jquery.com/jquery-2.2.1.min.js"></script> | ||
<!-- <script src="uikit.js"></script> --> | ||
<script src="https://cdn.jsdelivr.net/gh/diversen/pandoc-uikit@master/uikit.js"></script> | ||
<!-- <script src="scripts.js"></script> --> | ||
<script src="https://cdn.jsdelivr.net/gh/diversen/pandoc-uikit@master/scripts.js"></script> | ||
<!-- <script src="jquery.sticky-kit.js "></script> --> | ||
<script src="https://cdn.jsdelivr.net/gh/diversen/pandoc-uikit@master/jquery.sticky-kit.js"></script> | ||
|
||
<meta name="generator" content="pandoc-uikit" /> | ||
$for(author-meta)$ | ||
<meta name="author" content="$author-meta$" /> | ||
$endfor$ | ||
$if(date-meta)$ | ||
<meta name="date" content="$date-meta$" /> | ||
$endif$ | ||
<title>$if(title-prefix)$$title-prefix$ - $endif$$pagetitle$</title> | ||
<style type="text/css">code{white-space: pre;}</style> | ||
$if(quotes)$ | ||
<style type="text/css">q { quotes: "“" "”" "‘" "’"; }</style> | ||
$endif$ | ||
$if(highlighting-css)$ | ||
<style type="text/css"> | ||
$highlighting-css$ | ||
</style> | ||
$endif$ | ||
$for(css)$ | ||
<link rel="stylesheet" href="$css$" $if(html5)$$else$type="text/css" $endif$/> | ||
$endfor$ | ||
$if(math)$ | ||
$math$ | ||
$endif$ | ||
$for(header-includes)$ | ||
$header-includes$ | ||
$endfor$ | ||
</head> | ||
|
||
<body> | ||
|
||
|
||
<div class="uk-container uk-container-center uk-margin-top uk-margin-large-bottom"> | ||
|
||
$if(title)$ | ||
<div class="uk-grid" data-uk-grid-margin> | ||
<div class="uk-width-1-1"> | ||
<h1 class="uk-heading-large">$title$</h1> | ||
$if(date)$ | ||
<h3 class="uk-heading-large">$date$</p></h3> | ||
$endif$ | ||
$for(author)$ | ||
<p class="uk-text-large">$author$</p> | ||
$endfor$ | ||
</div> | ||
</div> | ||
$endif$ | ||
|
||
<div class="uk-grid" data-uk-grid-margin > | ||
<div class="uk-width-medium-1-4"> | ||
<div class="uk-overflow-container" data-uk-sticky="{top:25,media: 768}"> | ||
<div class="uk-panel uk-panel-box menu-begin" > | ||
|
||
$if(toc)$ | ||
$toc$ | ||
$endif$ | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
<div class="uk-width-medium-3-4"> | ||
|
||
$if(abstract)$ | ||
<H1>$abstract-title$</H1> | ||
$abstract$ | ||
$endif$ | ||
|
||
$body$ | ||
</div> | ||
</div> | ||
<script src="https://vjs.zencdn.net/5.4.4/video.js"></script> | ||
</div> | ||
</body> | ||
</html> |