Markdown Transformer. Transform markdown files to different formats

Overview

Mdtx

NPM Version

Inspired by generative programming and weed :). So I was learning Elm language at home usually in the evening and now I am missing all this generative stuff from Elm libs in TS.

What is generated now?

  • when you add Markdown files with gray matter it will generate typings for those

Installation

$ npm i mdtx

How to use

Init mdtx to provide input and output

$ mdtx --init

Then use mdtx to watch files and generate new file on every markdown/static file change

mdtx

Examples

Check example folder, generated content looks like this. It is a one big tree of safely typed md files.

export const htmlContent = {
  'basics/HowToStart.md': {
    content: '\n# Hello world\n',
    data: {
      title: 'How to start',
    },
    excerpt: '',
  },
  'Changelog.md': {
    content: '\n## 0.0.1\n\nFirst mdtx version\n',
    data: {
      link: 'changelog',
      title: 'Changelog',
      order: 99,
    },
    excerpt: '',
  },
} as const;

Roadmap

  • next js plugin
  • gatsby plugin
  • tree building
  • summary building
  • other language generation
You might also like...

This repository contains different infrastructure components that are used in different projects here at NaN Labs.

Infrastructure Reference Changelog | Contributing This repository contains different infrastructure components that are used in different projects her

Dec 15, 2022

A CLI for generating starter files for different JS frameworks with tailwindCSS pre-installed

A CLI for generating starter files for different JS frameworks with tailwindCSS pre-installed

tailwindcsscli A CLI for generating starter files for different JS frameworks with tailwindCSS pre-installed Installation To install the CLI, run the

Sep 30, 2022

Organizes all your files from from a folder into different section automatically.

File System Organizer Global command line application Organizes all your files from from a folder into different section automatically. Functionality

Jun 15, 2022

Zenload - "Load couple loaders and apply transform one-by-one

Zenload Load couple loaders and apply transforms one-by-one. Install npm i zenload -g How to use? With env vairable ZENLOAD: NODE_OPTIONS='"--loader

Jan 25, 2022

A typescript transform that converts exported const enums into object literal.

ts-transformer-optimize-const-enum A typescript transformer that convert exported const enum into object literal. This is just like the one from @babe

Jul 27, 2022

An imports transform unplugin.

unplugin-transform-imports An imports transform unplugin based on babel inspired by babel-plugin-transform-imports. What unplugin-transform-imports Do

Nov 29, 2022

Transform URLs in strings to actual links.

Transform URLs in strings to actual links.

Transform URLs in strings to actual links. It will find valid links in the given string and create a tags for it. Internally, it uses this Regex to

Nov 4, 2022

A plugin for Strapi Headless CMS that provides the ability to transform the API request or response.

strapi-plugin-transformer A plugin for Strapi that provides the ability to transform the API request and/or response. Requirements The installation re

Jan 6, 2023

Transform and compose data for HTTP transactions.

Transform and compose data for HTTP transactions.

Fragments Fragments is a platform to compose and manage custom data objects for HTTP transactions. Simply put, you can write simple jinja templates to

Sep 6, 2022
Comments
  • Make beautiful Readme

    Make beautiful Readme

    1. Name + Badges
    2. Short description
    3. GIF
    4. Short docs with installation and simple basic run
    5. Link to the landing page/docs
    6. Made by Aexol blabla
    7. How to help - star this repo
    opened by aexol 0
  • Allow to use custom unified visitors.

    Allow to use custom unified visitors.

    https://github.com/aexol-studio/mdtx/blob/main/packages/mdtx-core/src/transformers/markdown.ts In this file and in the nextJS plugin we should have a possibility to insert our own unified plugins.

     const processedContent = await unified()
        .use(remarkParse)
        .use(remarkDirective)
        .use(() => {
          return (tree, file) => {
            visit(tree, 'containerDirective', (node) => {
              const data = node.data || (node.data = {});
              const hast = h(node.name, node.attributes);
              data.hName = hast.tagName;
              data.hProperties = hast.properties;
            });
            visit(tree, 'html', (node) => {
              if (node.value.includes('src="')) {
                node.value = node.value.replace(
                  /src\=\".*\.gitbook/,
                  'src="/.gitbook',
                );
                // tree.children.push({ type: '' });
              }
            });
            visit(tree, 'paragraph', (node) => {
              const image = node.children.find((child) => child.type === 'image');
              if (image && image.type === 'image') {
                const fileName = image.url.replace(/^.*\.gitbook/, '/.gitbook');
                image.url = fileName;
              }
            });
          };
        })
        .use(remarkRehype, { allowDangerousHtml: true })
        .use(rehypeRaw)
        .use(rehypeHighlight)
        .use(rehypeStringify)
        .process(replaceCustomTags);
    
    opened by aexol 1
Owner
Aexol
Changing the world through software 🌍
Aexol
Font-end app to test the transformer model translation from Cape Verdian Creole to English

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

Roberto Carlos 5 Sep 28, 2022
TypeScript Transformer for injection-js

TypeScript Transformer for injection-js TypeScript Transformer for injection-js, inspired by angular-cli. Why need this No more emitDecoratorMetadata

Yadong Xie 13 Dec 4, 2022
A JSX transformer with extra hints around interpolations and outer templates.

@ungap/babel-plugin-transform-hinted-jsx This plugin is a follow up of this post and it can be used together with @babel/plugin-transform-react-jsx. A

ungap 12 Nov 12, 2022
Ordered lists, flat or nested, multiple formats ordered lists.

logseq-plugin-ol 有序列表,单级或多级、多种样式的有序列表。 Ordered lists, flat or nested, multiple formats ordered lists. 使用展示 (Usage) 在想要展示为有序列表的块上添加一个以 #.ol 开头的标签就可以了。有

Seth Yuan 25 Jan 1, 2023
Downloads & formats all of your Roblox private messages.

Roblox Message Downloader This tool was created due to the recent news sent out by Roblox. On April 22nd, 2022, all private messages sent by Roblox be

Raincoat Games 2 Apr 7, 2022
devDependency to test feed formats for ssb-db2

ssb-feed-format A tool that you install as a devDependency to check whether your feed format for SSB is correct and ready to be installed in ssb-db2.

Secure Scuttlebutt Consortium 3 Jun 18, 2022
front.phone is a Javascript library that identifies, validates and formats phone numbers.

front.phone front.phone is a Javascript library that identifies, validates and formats phone numbers. Demo The main goal of this project is to create

VTEX 55 Oct 27, 2022
Random Fractals stash of Observable Data Tools 🛠️ and Notebooks 📚 in ES Modules .js, .nb.json, .ojs, .omd, .html and .qmd document formats for Data Previews

Random Fractals stash of Observable Data Tools ??️ and Notebooks ?? in ES Modules .js, .nb.json, .ojs, .omd, .html and .qmd document formats for Data Previews in a browser and in VSCode IDE with Observable JS extension, Quarto extension, and new Quarto publishing tools.

Taras Novak 14 Nov 25, 2022
Formats message strings with number, date, plural, and select placeholders to create localized messages

Formats message strings with number, date, plural, and select placeholders to create localized messages. Small. Between 700 bytes and 1.3 kilobytes (m

Marcis Bergmanis 35 Oct 30, 2022
Chromium extension for displaying all the available formats of an AppleMusic album.

AppleMusic-Formats-Extension Chromium extension for displaying all the available formats of an AppleMusic album. Before Vs After How to Install? From

bunny 7 Dec 16, 2022