Git Product home page Git Product logo

Comments (5)

emgre avatar emgre commented on July 20, 2024

I think you can do it with this: https://mdxjs.com/getting-started#documents

So something like this:

import Changelog from '../CHANGELOG.md`
<Changelog /> 

from dnp3.

jadamcrain avatar jadamcrain commented on July 20, 2024

It didn't like the following raw markdown:

### 0.9.0 ###
* :tada: first official release

result:

image

from dnp3.

emgre avatar emgre commented on July 20, 2024

This is caused because the CHANGELOG.md file is not inside the /guide directory, so outside the docusaurus project. I tried writing a plugin for docusaurus with the following content, but it doesn't work (it tries to resolve configuration files that do not exist) and I gave up on it.

module.exports = function(ctx, options) {
    return {
        name: 'webpack-config',
        configureWebpack(config, isServer, utils) {
            var mdxConfig = config.module.rules[config.module.rules.length - 1];
            console.log(mdxConfig);
            return {
                module: {
                    rules: [
                        {
                            test: /(CHANGELOG.md)$/,
                            include: ['D:\\Desktop\\stepfunc\\dnp3'],
                            use: ['babel-loader', '@docusaurus/mdx-loader', '@docusaurus/plugin-content-pages/lib/markdownLoader'],
                        }
                    ]
                }
            }
        }
      };
}

The remaining solutions would be to create a symlink inside the /guide directory, but I'm not sure how git is going to handle it. Or, we could just link to the changelog on GitHub.

from dnp3.

jadamcrain avatar jadamcrain commented on July 20, 2024

I think linking to the changelog will be fine, so long as we can use a global version constant from the configuration to generate the link.

from dnp3.

emgre avatar emgre commented on July 20, 2024

I got it working in 1dec86b It copies the CHANGELOG.md to the appropriate directory so we can import it inline. Also, I added in 7aa3508 a JSON to contain the current version number (and other global information in the future) that we can reference from the docs. See https://github.com/stepfunc/dnp3/blob/1dec86b18a8ed2372b4e49f30f0d6ae8e5cacc0e/guide/docs/about/versioning.mdx for an example.

from dnp3.

Related Issues (20)

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.