diff --git a/css/style.css b/css/style.css index c9b726d..6188b0c 100644 --- a/css/style.css +++ b/css/style.css @@ -16,6 +16,68 @@ color: #ffffff; } +body { + min-height: 10rem; + padding-top: 55px; + } + +#forkongithub a{ + box-sizing: content-box; + background:#000; + color:#fff; + text-decoration:none; + font-family:arial,sans-serif; + text-align:center; + font-weight:bold; + padding:5px 40px; + font-size:1rem; + line-height:2rem; + position:relative; + transition:0.5s; +} +#forkongithub a:hover{ + background:#c11; + color:#fff; +} +#forkongithub a::before,#forkongithub a::after{ + content:""; + width:100%; + display:block; + position:absolute; + top:1px; + left:0; + height:1px; + background:#fff; +} +#forkongithub a::after{ + bottom:1px; + top:auto; +} +@media screen and (min-width:800px){ + #forkongithub{ + position:absolute; + display:block; + top:0; + right:0; + width:200px; + overflow:hidden; + height:200px; + z-index:9999; + } + #forkongithub a{ + width:200px; + position:fixed; + top:60px; + right:-60px; + transform:rotate(45deg); + -webkit-transform:rotate(45deg); + -ms-transform:rotate(45deg); + -moz-transform:rotate(45deg); + -o-transform:rotate(45deg); + box-shadow:4px 4px 10px rgba(0,0,0,0.8); + } +} + blockquote { font-style: normal; @@ -24,7 +86,7 @@ blockquote font-family: Consolas, "Times New Roman", Verdana; border-left: 4px solid #CCC; padding-left: 8px; - background: #eee; +background: #eee; } span.emoji-sizer @@ -156,3 +218,8 @@ flex-wrap: wrap; { max-width: 100%; } +#content +{ + padding-bottom: 25px; + padding-top: 10px; +} diff --git a/hosts/localhost/config.php b/hosts/localhost/config.php index 0731054..b9a1112 100644 --- a/hosts/localhost/config.php +++ b/hosts/localhost/config.php @@ -10,3 +10,5 @@ define('LOG_FILE', 'log.txt'); define('ACCESS_IP', ''); define('HISTORY_FILE', 'history.txt'); define('MAX_HISTORY_FILES', 5); +define('LANGUAGE', 'en'); + \ No newline at end of file diff --git a/hosts/localhost/content/apropos.md b/hosts/localhost/content/apropos.md new file mode 100644 index 0000000..f3d7238 --- /dev/null +++ b/hosts/localhost/content/apropos.md @@ -0,0 +1,8 @@ +# About author + +![moi](/moi.jpg?80-left)**Hordé Nicolas** + +> *Passionate about computer and more particularly development. I started from a young age (17 years) in system programming. I handle about thirty programming languages ​​among which there are many low level languages: wink:! I am also the author of MarkDoc, the Markdown-based documentation management system you are currently viewing * + + + diff --git a/hosts/localhost/content/dependencies.md b/hosts/localhost/content/dependencies.md new file mode 100644 index 0000000..1ee73ca --- /dev/null +++ b/hosts/localhost/content/dependencies.md @@ -0,0 +1,38 @@ +# Dependencies + +## Emoji Support + +*Thanks to Cal Henderson* + + * https://github.com/iamcal/js-emoji + * https://github.com/iamcal/php-emoji + * https://github.com/iamcal/emoji-data + +## Converting Markdown + +*Thanks to Emanuil Rusev* + + * https://github.com/erusev/parsedown-extra + * https://github.com/erusev/parsedown + +## Editing markdown + +*Thanks to Wes Cossick* + + * https://github.com/sparksuite/simplemde-markdown-editor + +## Syntax highlighting + + * https://github.com/PrismLibrary/Prism + +## Icons + + * https://github.com/FortAwesome/Font-Awesome + +## Essential + + * https://github.com/twbs/bootstrap + * https://github.com/jquery/jquery + * https://github.com/popperjs/popper-core + * https://github.com/zenorocha/clipboard.js + * https://github.com/codepo8/css-fork-on-github-ribbon \ No newline at end of file diff --git a/hosts/localhost/content/features.md b/hosts/localhost/content/features.md new file mode 100644 index 0000000..f16b4d7 --- /dev/null +++ b/hosts/localhost/content/features.md @@ -0,0 +1,20 @@ +# Features + +## Actual + +1. Simple Website with customizables menus +2. Markdown Editor with syntax highlighting and Emoji support +3. Very fast loading with ajax support +4. Multiple websites hosting with single MarkDoc installation +3. Integrated Image viewer +4. Restricted access by ip address +5. Admin access logging + +## Planned + +1. Complete File Manager +2. Password protected area +3. Keeping the history of edited files and changes +4. Configuration viewer +5. Emoji menu in Markdown editor +6. Uploading multiple files by drag and drop diff --git a/hosts/localhost/content/index.md b/hosts/localhost/content/index.md new file mode 100644 index 0000000..55d3103 --- /dev/null +++ b/hosts/localhost/content/index.md @@ -0,0 +1,25 @@ +# MarkDoc + +**PHP Markdown-based documentation management system, Free & OpenSource :heart_eyes: for easily create your documentation website** + +This website is heavily formated with markdown format ! +``` + __ __ _ _____ + | \/ | | | | __ \ + | \ / | __ _ _ __| | _| | | | ___ ___ + | |\/| |/ _` | \'__| |/ / | | |/ _ \ / __| + | | | | (_| | | | <| |__| | (_) | (__ + |_| |_|\__,_|_| |_|\_\_____/ \___/ \___| +``` + +![gplV3](https://www.gnu.org/graphics/gplv3-127x51.png) Sous licence GPLv3 [Licence](/special/gpl-3.0.md) - *Sources downloadables on [GitHub](https://github.com/dahut87/MarkDoc)* + +Based on Pheditor "PHP file editor" released under MIT license + +*Specials thanks to Hamid Samak* + +Made in 2020 by Nicolas H. + +--- + +For more informations, visit the demo website running MarkDoc engine at : [https://markdoc.palon.fr](https://markdoc.palon.fr) diff --git a/hosts/localhost/content/moi.jpg b/hosts/localhost/content/moi.jpg new file mode 100644 index 0000000..98540fe Binary files /dev/null and b/hosts/localhost/content/moi.jpg differ diff --git a/hosts/localhost/content/special/nav.md b/hosts/localhost/content/special/nav.md index 0357874..1a03d07 100644 --- a/hosts/localhost/content/special/nav.md +++ b/hosts/localhost/content/special/nav.md @@ -1,3 +1,3 @@ -[Accueil](/index.md) -[Plan du site](:SITEMAP) -[Glossaire](:GLOSSAIRE) +[Home](/index.md) +[Sitemap](:SITEMAP) +[Glossary](:GLOSSAIRE) diff --git a/hosts/localhost/content/usage.md b/hosts/localhost/content/usage.md new file mode 100644 index 0000000..726b0b6 --- /dev/null +++ b/hosts/localhost/content/usage.md @@ -0,0 +1,54 @@ + +# Usage + +## Installation + +Installation using git + +``` +git clone https://github.com/dahut87/MarkDoc.git [website_root] +``` + +Install Emoji data and copy Emoji data to the "emoji-data" + +``` +wget https://github.com/iamcal/emoji-data/archive/v6.0.0.zip +unzip v6.0.0.zip +mv emoji-data-v6.0.0 emoji-data +``` + +## Configuration + +There is a sample website in the "[website_root]/hosts/locahost" directory. It's easy to add a new one, you create one subfolder by name served by your webserver. + +``` +[website_root]/hosts/example.com +[website_root]/hosts/test.sample.fr +``` + +## Configuration + +The configuration file is named 'config.php', is located in the [website_root]/hosts/[host]/config.php. + +List of the parameters you can modify +``` +define('SUBCONTENT_DIR', 'content'); +define('SHOW_HIDDEN_FILES', false); +define('VIEWABLE_FORMAT', 'md'); +define('TITLE', 'Documentation'); +define('ICON', 'fa-book-open'); +define('ALLOWED_EXT','jpg,svg,gif,png,c,tgz,tar.gz,gz,tar,sql,ico'); +define('PASSWORD', '[sha512 encoded password]'); +define('LOG_FILE', 'log.txt'); +define('ACCESS_IP', ''); +define('HISTORY_FILE', 'history.txt'); +define('MAX_HISTORY_FILES', 5); +``` + +**NOTE**: +There is no default password. To generate it, use the sha512sum command line like this: + +```bash +user@computer:~$ echo -en "password"|sha512sum|cut -d " " -f1 +b109f3bbbc244eb82441917ed06d618b9008dd09b3befd1b5e07394c706a8bb980b1d7785e5976ec049b46df5f1326af5a2ea6d103fd07c95385ffab0cacbc86 +``` \ No newline at end of file diff --git a/hosts/localhost/index.md b/hosts/localhost/index.md deleted file mode 100644 index 217dc05..0000000 --- a/hosts/localhost/index.md +++ /dev/null @@ -1,18 +0,0 @@ -# MarkDoc - -**PHP MarkDown document manager, Free & OpenSource :heart_eyes: for easily create your documentation website** - -``` - __ __ _ _____ - | \/ | | | | __ \ - | \ / | __ _ _ __| | _| | | | ___ ___ - | |\/| |/ _` | \'__| |/ / | | |/ _ \ / __| - | | | | (_| | | | <| |__| | (_) | (__ - |_| |_|\__,_|_| |_|\_\_____/ \___/ \___| -``` - -![gplV3](https://www.gnu.org/graphics/gplv3-127x51.png) Sous licence GPLv3 [Licence](/special/gpl-3.0.md) - *Sources téléchargéables sur [GitHub](https://github.com/dahut87/MarkDoc)* - -Based on Pheditor "PHP file editor" By Hamid Samak Release under MIT license - -2020 par Nicolas H. diff --git a/index.php b/index.php index 2ca0267..6cd9564 100644 --- a/index.php +++ b/index.php @@ -29,7 +29,7 @@ testip(); logprotect(); ### Sessions -session_name('mesdocumentations'); +session_name($_SERVER['SERVER_NAME']); session_start(); /*var_dump($_POST); @@ -148,19 +148,11 @@ else ':''); ?> - - - - - - - - -':''); ?> +
@@ -218,5 +211,14 @@ print(($_SESSION['md_admin'] == true)?'