GithubHelp home page GithubHelp logo

markdown_geshi_example's Introduction

Markdown + Geshi example

There is example of usage markdown and geshi code highlighter for blog posts.

Related article: http://antonshell.me/post/markdown-geshi-highlight

GeSHi - Generic Syntax Highlighter, written in PHP https://github.com/GeSHi/geshi-1.0

Markdown parser: https://github.com/erusev/parsedown

Demo

Code higlight example:

markdown_geshi_example

Demo available here: http://demo.antonshell.me/markdown_geshi_example/

Setup

1 . Clone repository

git clone ...

2 . Install dependencies

composer install 

3 . Build posts

php build_posts.php

Usage:

1 . Build posts

php build_posts.php

2 . See posts

http://127.0.0.1:8100/index.php?url=demo-markdown
http://127.0.0.1:8100/index.php?url=elastic-search-nginx-proxy

How it works:

1 . You create post in markdown format. See posts folder

2 . Add code blocks with specific language. For example:

<?php

return [
    'vendor' => 'Company',
    'module_name' => 'Filters',
    'module_name_underscore' => 'DIY_Filters',
    'view_path' => 'filters',
    'entity' => 'Filter',
    'view_path_ucf' => 'Filters',
    'entity_lower' => 'filter',
    'setup_version' => '1.0.0',
    'table_name' => 'company_filter',
];

3 . Run console command.

php build_posts.php

Html files will be generated in build/posts folder

4 . Then you can show them in your blog pages

$urlPath = __DIR__ . '/build/posts/demo-markdown.html';
require $path;

markdown_geshi_example's People

Contributors

antonshell avatar

Watchers

James Cloos 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.