Code Monkey home page Code Monkey logo

md_website's Introduction

.MD Website

Simple, Deno CLI to generate simple websites from Markdown files. Checkout the example at: https://md-website-example.now.sh/

Our goal is to utilize https://newcss.net/ as a super simple framework to render markdown files that are parsed to HTML. A navigation will be generated based on the filenames.

Install it using use:

deno install --allow-read --allow-write --force --name mdw https://raw.githubusercontent.com/HoverBaum/md_website/master/index.ts

This will install the latest version. We need read and write access tor ead the Markdown files and write the parsed HTML. --force makes sure to replace previous installations and --name mdw aliases the cli to mdw.

Usage

Simply run the below command in a folder containing markdown files. Currently subfolders are not parsed. You will get a folder named "public" containing the output.

It's a good practive to have an entry file named index.md.

mdw

You can also run without installing first by running the below command.

deno run --allow-read --allow-write https://raw.githubusercontent.com/HoverBaum/md_website/master/index.ts

Questions and answers

Why the super explicit imports?

Instead of following the obvious version from the docs (as of 0.51.0) and importing the stdLib dependencies from the masters mod.ts we opt to import them from their files using an explicit version.

// We use:
import { ensureDir } from 'https://deno.land/[email protected]/fs/ensure_dir.ts'

// Instead of:
import { ensureDir } from 'https://deno.land/std/fs/mod.t'

This has two reasons to it:

  • Versioning importing all dependencies from master, though they should be the same compatible version, caused compatibility issues between stdLibs. And pinning versions anyway is a good idea so that we don't break just because someone pushed broken code to some dependencies master.
  • unstable while the stdLibs are stable the feature to import them from mod.ts files is (as of writing this, Deno 1.0.0) still hidden behind the --unstable flag and we did not want our users to have to use that.

md_website's People

Contributors

hoverbaum avatar

Stargazers

netop://ウエハ avatar David Else avatar Amolo avatar M. Rifqi Saiful A. H. avatar Marc Espin avatar WJH avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.