Code Monkey home page Code Monkey logo

md-page's Introduction

logo

markdown page

Create a webpage with just markdown!

Installation

  1. Create a new html page, my-page.html

  2. Add the following script tag at the very top of the page

  3. Write some markdown

<!-- my-page.html --> 
<script src="https://rawcdn.githack.com/oscarmorrison/md-page/232e97938de9f4d79f4110f6cfd637e186b63317/md-page.js"></script><noscript>


# Header
Welcome to my simplest site

- An
- awesome
- list

(see the docs for more info)

Demo

editable demo: https://jsbin.com/katuyos/edit?html,output
live demo: https://oscarmorrison.github.io/md-page/

side-by-side

md-page's People

Contributors

a12baghel2 avatar doctor-vee avatar gaganshera avatar lawrence4code avatar leomedina avatar oscarmorrison avatar p1ho avatar rishabh1403 avatar saschanaz avatar stefanocappellini avatar szepeviktor avatar tamalchowdhury avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

md-page's Issues

Don't override head styles

If styles exist in the head already, do not override this styles.

Make the md-page styles the least important of all styles

Convert to HTML?

Thanks for writing this. I like this type of page builder. I tried saving the page once loaded in Firefox but it's not saving as an HTML page, just the source code markdown is saved. Is there any way to get the actual html the browser is showing us? I know that markdeep, which is similar, has a ?export function to get the html. Have you thought of maybe adding something like that?

Can't make external stylesheet to work.

I'm using this script, but would like an external css file, but can't seem to make it work:

`

<script src="https://rawcdn.githack.com/oscarmorrison/md-page/master/md-page.js"></script>

Test`

And the CSS
h2 { color: blue; }

The H2 doesn't get the blue color. It generates an H2 tag, but no css attaches to it. The style sheet exists when I checked via the browser. So it seems to find it. What am I missing?

Idea: generated navigation tree

An optional parameter could use a certain title rank (h2 for instance) to generate a navigation tree into a navigation bar:

# My website

Welcome to my website

## Cool ideas

- Idea 1
- Idea 2
- Idea 3

## Friends

I love my friends:
- Friend 1
- Friend 2
- Friend 3

## Contacts

Contact me by fax!

โ€ฆwould generate:

<ul>
  <li><a href="#cool-ideas"></a>Cool ideas</li>
  <li><a href="#friends"></a>Friends</li>
  <li><a href="#Contact"></a>Contact</li>
</ul>

This could be nice to have a basic but effective navigation system, able to turn the page into a single page website. What do you think?

Question about setting up dev

Hello,

I have a question about DEV_README
I understand uglify-js is needed to compile the js files you have, but I'm unsure what make is referring to. Is this related to the Makefile ?
I got the build process to run using the command ./Makefile on Git Bash on Windows 10, but I can't specify whether I want to run concat or setup.

Emoji Cheatsheet

There should be human-readable documentation on what emoji shortcuts create what images.

Automating Build Process

I don't know if this is necessary, but I think it's somewhat redundant to ask everyone who submits a PR to also submit the minified code.

We could implement a build process, where we ask people to make PR to a review branch.
If it's approved and merged, it will activate a build process somewhere else (using tools like Travis CI) and push the minified version to the master branch if it passed all tests (which is currently being discussed #21)

The good thing is, this will maintain backwards compatibility as it does not change the githack URL for the minified file that's being imported by all current users.

Cloudflare's rocket

Please consider disabling Rocket loader on oscarmorrison.com/md-page
I makes a big FOUC.

Can i use md-page in IE11 ?

hello.

I use md-page a lot because it's very convenient.

When i use IE11, md page does not work.
Some users are still using IE...

Is there a way to get md-page working in IE ?

Problem with accented characters like รก etc.

If I use an accented character in my Markdown .html content I get a wrong character instead in the rendered document. I can easily fix that adding a meta charset="UTF-8" tag at the beginning of my .html document, sure, but maybe this is something you could fix for everyone?

Using images

I'm wondering if it's possible to display images referenced in the MD document. In my case they are saved relative to the document, like this:

![My fancy Image](img/image01.png)

Write some tests

Would be good to have some basics tests in here.

Could just use jest, or something else. Very open to ideas

Call a user-supplied function when conversion complete?

It would be nice if md-page was able to call a user-supplied function when its own conversion is complete. This user function could always be named onMdPageComplete() โ€” md-page would call this function, if it exists, when it has done its stuff.

My own use case is to implement some images that popup on hover, via a lookup on the contents of the innerText of all the <a> elements.

Ability to inject own styles?

Hey man, very cool project! You did good job here. I might have overlooked something but is there a possibility to add my own styles?

Let's say I want all the text to be justified or all the headings to be #bada55 colored.

Clarify the docs

  • "with just markdown"
  • "then uses the amazing showdown" markdown converter/parser
  • "not a tech savvy"

You need to say that they also need Showdown and need to add it too. Also show that in the example.

Add some more documentation

Current wiki is pretty bare, would be good to have some more detailed examples.

  • with custom styles
  • with html elements
  • etc

npm run test fails: 18 snapshots failed.

When I run npm run test I am getting the following error:
...
`โ— HTML Rendering Tests: Ensures Blockquotes are rendered accurately โ€บ It should render multiple-line blockquotes

expect(received).toMatchSnapshot()

Snapshot name: `HTML Rendering Tests: Ensures Blockquotes are rendered accurately It should render multiple-line blockquotes 1`

Snapshot: "<blockquote>
  <p>Line 1<br>
  Line 2<br>
  Line 3</p>
</blockquote>"
Received: ""

  207 |     await dom.window.document.addEventListener('DOMContentLoaded', async () => {
  208 |       await setImmediate(() => { }); // This is required for the second DOMContentLoaded.
> 209 |       expect(dom.window.document.body.innerHTML).toMatchSnapshot();
      |                                                  ^
  210 |       done();
  211 |     });
  212 |   });

  at Document.<anonymous> (test/script.test.js:209:50)

โ€บ 18 snapshots failed.
Snapshot Summary
โ€บ 18 snapshots failed from 1 test suite. Inspect your code changes or press u to update them.

Test Suites: 1 failed, 1 total
Tests: 18 failed, 18 total
Snapshots: 18 failed, 18 total
`

Bootstrap + MD-page

Can you try a Bootstrap + your MD-page plugin? Example:

<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">

    <title>Hello, world!</title>
  </head>
  <body>
    <noscript>

    ##Blabla
    ####Lorem ipsum

    </noscript>

    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <script src="https://raw.githubusercontent.com/oscarmorrison/md-page/master/md-page.js"></script>
  </body>
</html>

Syntax highlight for inline code does not work

First of all, thank you very much for such contribution to community!

Here when I try to write powershell code with syntax highlighting, it fails.

Markdown:
resim

Expected:

function Is-WindowAvailable {
    param(
        [string]$QueryProcess,
        [string]$WindowTitle
    )

Result:
resim

French accent issue

Hi
So far, very useful. I was wondering if the french accent issue you can see in the image can be fixed with ease :) ?
regards

image

IE 11 issues

It would appear that IE may require more polyfills than we initially thought.
image
I can try to get to the bottom of this.

Relevant:
#43 #44

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.