Make your project documentation (or blog, or something else) with Markdown.
- HTML-generating on-the-fly from the Markdown files.
- Generating of navigation on-the-fly.
- Dynamic permissions management:
- Each user has a list of roles (roles are like GitHub's organization's groups).
- Each page and directory should have a list of roles.
- User can see the page (in navigation too) if he has at least one role from page's list.
- Search on all pages depending on access rights of current user.
- Preview of result html page in creating page.
- All settings and access rights are fully configurable (using admin panel or changing the code).
- Too easy to add new setting — admin panel is generated too. You simply need to add new setting and default value, and then you will be able to configure it in admin panel.
- You can simply copy your markdown files to
views/pages/
and (if it necessary) manage access to paths — and then your documentation is ready :) All new pages and directories will be indexed at next page loading. - Nice looking & adaptive design for all screen sizes.
- Other small but useful features:
- Each header has
#link
to it - Most code snippets will have copy button on header above
- You can use all
kramdown
features Main pages folder
from configuration will be always on top in navigation on each page.- Pages will have default access rights from config and will be placed in
Main pages folder
if you wont specify path or roles. - Advanced error handling (page with information about error will be shown for each error, so no crashes must occur)
- Each header has
This readme page after rendering:
And mobile version (iPhone 8 Plus):
Any *NIX OS is supported. No guarantees for Windows.
- Make some directory for installing mongodb from docker:
cd ~
mkdir mongodocker
cd mongodocker
- Copy necessary files from mongo-docker repository:
export MONGODB_VERSION=4.0
curl -O --remote-name-all https://raw.githubusercontent.com/docker-library/mongo/master/$MONGODB_VERSION/{Dockerfile,docker-entrypoint.sh}
export DOCKER_USERNAME=username
chmod 755 ./docker-entrypoint.sh
- Create
docker-compose.yml
in your directory with following content:
version: '2'
services:
mymongo:
image: mymongo
container_name: mymongo
restart: always
build:
context: .
dockerfile: ./Dockerfile
ports: ["27017:27017"]
volumes:
- '/etc/mongod.conf:/etc/mongod.conf'
command:
- '--config'
- '/etc/mongod.conf'
networks:
mongo_net:
ipv4_address: 172.22.0.2
networks:
mongo_net:
driver: bridge
ipam:
config:
- subnet: 172.22.0.2/24
gateway: 172.22.0.254
Where 172.22.0.2
is public IP for accessing database. You can change it.
- Create
/etc/mongod.conf
with following content:
storage:
dbPath: /data/db
journal:
enabled: true
net:
port: 27017
bindIp: 127.0.0.1,172.22.0.2 # here you can see this IP again
- Start mongo in background:
docker-compose up -d
- Clone this repo. I'm not gonna to upload project to npm, etc.
git clone https://github.com/petersamokhin/markdown-site
- See started networks and find
mongodb
network's name:
docker network ls
You must see something like this:
NETWORK ID NAME DRIVER SCOPE
a117428b09c9 bridge bridge local
0b75179024f0 host host local
b1c67fcbca63 mongo-docker_mongo_net bridge local
df7d198ae6c2 none null local
Find network with name like mongo-docker_mongo_net
. It can be literally mongo-docker_mongo_net
.
-
Change the name of a mongo network at the end of this project's
docker-compose.yml
. Now it'smongo-docker_mongo_net
. -
Start project in the background:
docker-compose up -d
You can use local MongoDB which is not in docker container, in this case, you must do it by yourself.
Profit!
- babel
- bcrypt-nodejs
- cheerio
- CodeMirror
- connect-mongo
- consolidate
- cookie-parser
- directory-tree
- eslint
- express
- express-session
- jQuery
- Kotlin Website styles
- kramdown
- materialize
- mkdirp
- mongoose
- morgan
- mustache
- passport
- passport-local
- tags-input
MIT
Copyright (c) 2018 PeterSamokhin
https://petersamokhin.com/