-
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.
Merge pull request #1 from n0nag0n/patch-1
Convert docs site to use Markdown
- Loading branch information
Showing
10 changed files
with
2,426 additions
and
1,966 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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,32 @@ | ||
</div><!--//doc-body--> | ||
</div><!--//container--> | ||
</div><!--//doc-wrapper--> | ||
|
||
</div><!--//page-wrapper--> | ||
|
||
<footer id="footer" class="footer text-center"> | ||
<div class="container"> | ||
<!--/* This template is free as long as you keep the footer attribution link. If you'd like to use the template without the attribution link, you can buy the commercial license via our website: themes.3rdwavemedia.com Thank you for your support. :) */--> | ||
<small class="copyright">Designed with <span class="sr-only">love</span><i class="fas fa-heart"></i> by <a | ||
href="https://themes.3rdwavemedia.com/" target="_blank">Xiaoying Riley</a> for developers</small> | ||
|
||
</div><!--//container--> | ||
</footer><!--//footer--> | ||
|
||
|
||
<!-- Main Javascript --> | ||
<script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script> | ||
<script src="assets/plugins/stickyfill/dist/stickyfill.min.js"></script> | ||
<script src="assets/plugins/gumshoe/gumshoe.polyfills.min.js"></script> | ||
<script src="assets/plugins/simplelightbox/simple-lightbox.min.js"></script> | ||
<script src="assets/js/main.js"></script> | ||
<script src="assets/plugins/highlight/highlight.min.js"></script> | ||
<script src="assets/plugins/highlight/languages/bash.min.js"></script> | ||
<script src="assets/plugins/highlight/languages/xml.min.js"></script> | ||
<script src="assets/plugins/highlight/languages/php.min.js"></script> | ||
<script src="assets/plugins/highlight/languages/javascript.min.js"></script> | ||
<script>hljs.highlightAll();</script> | ||
|
||
</body> | ||
</html> | ||
|
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,38 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<title>Fomo documentation</title> | ||
<!-- Meta --> | ||
<meta charset="utf-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="description" content=""> | ||
<meta name="author" content=""> | ||
<link rel="shortcut icon" href="favicon.ico"> | ||
<link href='https://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,700italic,800italic,400,300,600,700,800' | ||
rel='stylesheet' type='text/css'> | ||
<!-- FontAwesome JS --> | ||
<script defer src="assets/fontawesome/js/all.js"></script> | ||
<!-- Global CSS --> | ||
<link rel="stylesheet" href="assets/plugins/bootstrap/css/bootstrap.min.css"> | ||
<!-- Plugins CSS --> | ||
<link rel="stylesheet" href="assets/plugins/elegant_font/css/style.css"> | ||
<link rel="stylesheet" href="assets/plugins/simplelightbox/simple-lightbox.min.css"> | ||
<!-- Theme CSS --> | ||
<link id="theme-style" rel="stylesheet" href="assets/css/styles.css"> | ||
<link rel="stylesheet" href="assets/plugins/highlight/styles/base16/material-palenight.min.css"> | ||
|
||
</head> | ||
|
||
<body class="body-green"> | ||
<div class="page-wrapper"> | ||
<div class="doc-wrapper"> | ||
<div class="container"> | ||
<div id="doc-header" class="doc-header text-center"> | ||
<img src="assets/images/logo.png" width="300px"> | ||
</div><!--//doc-header--> | ||
<div class="doc-body row"> | ||
<div class="doc-content col-md-9 col-12 order-1"> | ||
<div class="content-inner"> | ||
<section class="doc-section"> | ||
<div> |
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,24 @@ | ||
</div> | ||
</section> | ||
</div><!--//content-inner--> | ||
</div><!--//doc-content--> | ||
<div class="doc-sidebar col-md-3 col-12 order-0 d-none d-md-flex"> | ||
<div id="doc-nav" class="doc-nav"> | ||
<nav id="doc-menu" class="nav doc-menu flex-column sticky"> | ||
<?php foreach($headings as $h1_id_tag => $h1_data) { ?> | ||
<li class="nav-item"> | ||
<a class="nav-link scrollto" href="#<?php echo $h1_id_tag; ?>"><?php echo $h1_data['text']; ?></a> | ||
</li> | ||
<?php if(!empty($h1_data['children'])) { ?> | ||
<nav class="nav doc-sub-menu nav flex-column"> | ||
<?php foreach($h1_data['children'] as $h2_id_tag) { ?> | ||
<li class="nav-item"> | ||
<a class="nav-link scrollto" href="#<?php echo $h2_id_tag['id']; ?>"><?php echo $h2_id_tag['text']; ?></a> | ||
</li> | ||
<?php } ?> | ||
</nav> | ||
<?php } ?> | ||
<?php } ?> | ||
</nav><!--//doc-menu--> | ||
</div> | ||
</div><!--//doc-sidebar--> |
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,44 @@ | ||
<?php | ||
|
||
ob_start(); | ||
|
||
require __DIR__ . '/vendor/autoload.php'; | ||
|
||
require __DIR__ . '/assets/includes/header.html'; | ||
|
||
$markdown = file_get_contents(__DIR__ . '/docs.md'); | ||
|
||
// Convert the markdown to HTML | ||
$Parsedown = new Parsedown(); | ||
$html = $Parsedown->text($markdown); | ||
|
||
// find all <h2> tags and add an id attribute, class, and necessary tags with the text content | ||
$headings = []; | ||
$last_h1_tag = ''; | ||
$html = preg_replace_callback('/<(h1|h2)>(.*?)<\/(h1|h2)>/', function($matches) use (&$headings, &$last_h1_tag) { | ||
$raw_text = $matches[2]; | ||
// make the id seo friendly | ||
$id = strtolower(str_replace(' ', '-', $matches[2])); | ||
$id = preg_replace('/[^a-z0-9-]/', '', $id); | ||
$tag = $matches[1]; | ||
// h1 gets treated differently than h2 | ||
if($tag === 'h1') { | ||
$headings[$id] = [ 'text' => $raw_text, 'children' => [] ]; | ||
$last_h1_tag = $id; | ||
} else { | ||
$headings[$last_h1_tag]['children'][] = [ 'text' => $raw_text, 'id' => $id ]; | ||
} | ||
return "</div></section><section class=\"doc-section\"><{$matches[1]} class=\"section-title\" id=\"$id\">{$matches[2]}</{$matches[1]}><div class=\"section-block\">"; | ||
}, $html); | ||
|
||
// add a class="table table-bordered" to all tables | ||
$html = str_replace('<table>', '<table class="table table-bordered">', $html); | ||
|
||
echo $html; | ||
|
||
// This will add the $headings array to the sidebar to be foreached | ||
require __DIR__ . '/assets/includes/sidebar.php'; | ||
|
||
require __DIR__ . '/assets/includes/footer.html'; | ||
|
||
file_put_contents(__DIR__ . '/index.html', ob_get_clean()); |
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,5 @@ | ||
{ | ||
"require": { | ||
"erusev/parsedown": "^1.7" | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.