Giter Site home page Giter Site logo

metacms's Introduction

metacms's People

Contributors

tshemsedinov avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

metacms's Issues

Research: parsersing markdown format

Steps:

  1. Find and research markdown parsers. Prepare short talk at meeting (about 10 min)
  2. Propose API and feature list for our internal markdown parser implementation
  3. Implement markdown parser as a submodule of metacms or a separate module (we will make decision later)

FYI: @leonpolak

Refactor and check ready code for markdown parser

Refactor code from issue #2
and try to use it.

const tags = [
      // starts, ends, tag start, tag end, true = replace / false = as is
      ['##', '\n', '<h2>', '</h2>', false],
      ['#', '\n', '<h1>', '</h1>', false],
      ['**', '**', '<strong>', '</strong>', true],
      ['*', '*', '<em>', '</em>', true],
      ['~~', '~~', '<del>', '</del>', true],
      ['``', '``', '<pre><code>', '</code></pre>', true],
      ['`', '`', '<code>', '</code>', true],
      ['>', '\n', '<blockquote>', '</blockquote>', false],
      ['-', '\n', '<li>', '</li>', true, ['\n\n', '\n\n', '<ul>', '</ul>']],
      ['\n\n', '\n\n', '<p>', '</p>', true],
    ];

    const parse = (md) => {
      const stack = [];
      let n = 0;
      const length = md.length;
      const res = [];
      let tag, close, found, ul;

      while (n < length) {
        // console.log(md.charAt(n), md.charCodeAt(n));
        if (close && md.substr(n, close[1].length) === close[1]) {
          res += close[3];
          if (close[5] && md.substr(n, close[5][1].length) === close[5][1]) {
            res + close[5][3];
          }
          stack.pop();
          if(close[4]) n += close[1].length;
          if(stack.length > 0){
            close = stack[stack.length - 1];
          } else {
            close = null;
          }
        } else {
          found = false;
          for (tag of tags) {
            if (md.substr(n, tag[0].length) === tag[0]) {
              if (tag[5] && md.substr(n-tag[5][0].length, tag[5][0].length) === tag[5][0]) {
                res + tag[5][2];
              }
              res += tag[2];
              stack.push(tag);
              close = tag;
              found = true;
              n += tag[0].length;
              break;
            }
          }
          if (!found) {
            res += str[n];
            n++;
          }
        }

      }
      return res;
    };

Run build process on landing to master/main

We need two implementations:

  • Start github actions on create pull-request and add new commit wit generated static html files
  • Use web hook on production server to intercept landing pull-request to run build process

FYI: @georgolden

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.