Giter Site home page Giter Site logo

markmap's Introduction

markmap's People

Contributors

deining avatar dejavu333 avatar dermolly avatar gera2ld avatar gitter-badger avatar ilyes-ced avatar manateelazycat avatar mister-hope avatar spier 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  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

markmap's Issues

TypeError with horizontal rule

# Foo

## Bar

---

## Baz

#### Quux

Results in:

(node:20389) UnhandledPromiseRejectionWarning: TypeError: token.children is not iterable
    at extractInline (/home/roger/.nvm/versions/node/v12.16.1/lib/node_modules/markmap-lib/dist/index.js:29:29)
    at buildTree (/home/roger/.nvm/versions/node/v12.16.1/lib/node_modules/markmap-lib/dist/index.js:202:25)
    at transform (/home/roger/.nvm/versions/node/v12.16.1/lib/node_modules/markmap-lib/dist/index.js:212:14)
    at createMarkmap (/home/roger/.nvm/versions/node/v12.16.1/lib/node_modules/markmap-lib/dist/index.js:241:16)
(node:20389) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:20389) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Codes in markdown is omitted

Markdown source file:

# Time Schemes

## Implicit Time Schemes

### BDF

### Comparative Study

- `YuMeilin-2019arXiv-CompareRosenbrock_ESDIRK_BDF`

## Multigrid Methods

Html output:
nodecode

YuMeilin-2019arXiv-CompareRosenbrock_ESDIRK_BDF is omitted in the html file.

markmap-lib version:

$ markmap --version
0.4.2

Non-linear references

Hi! Really cool tool. Is there any support for non-liner references? For example when a grandchild of A has a connection to a child of B, or an item is connected to multiple parents? Basically, drawing a connection between two nodes that are not in the same branch.

# Goals

## Open new branch
- Close property deal
- Hire additional team members [connects to Secure new investment]

## Secure new investment
- Prepare business plan
- Find investors

It seems that wrong <em> tags occurs when converting files

I was working with inline math formulas. It seems that when dealing with formulas whose 'd' is high, the em tag might untimely occurs, causing a chaos in the following few lines.
Annotation 2020-08-05 223117

my note and generated html are here:
https://ym-ma.github.io/markdown.md
https://ym-ma.github.io/markdown.html

I inserted codes into the generated html file to enalbe inline math:
<script src="https://ym-notes.oss-cn-beijing.aliyuncs.com/img/load-mathjax.js" async></script>

403 error code when access gist from github

When I use the markmap to read gist from github, from the console of Chrome, I get a 403 error code, which said it is a rate limit error. It happens sometime, not always.

i got a type error after using the markmap node.md command

that is the result after i typing markmap test.md and i am sure that the md file is correct.
(node:528) UnhandledPromiseRejectionWarning: TypeError: processors is not iterable at getParams (C:\Users\cmw天下第一\AppData\Roaming\npm\node_modules\markmap-lib\dist\template.js:37:23) at C:\Users\cmw天下第一\AppData\Roaming\npm\node_modules\markmap-lib\dist\util\loader.js:130:116 at Array.map (<anonymous>) at persistJS (C:\Users\cmw天下第一\AppData\Roaming\npm\node_modules\markmap-lib\dist\util\loader.js:122:16) at fillTemplate (C:\Users\cmw天下第一\AppData\Roaming\npm\node_modules\markmap-lib\dist\template.js:24:79) at createMarkmap (C:\Users\cmw天下第一\AppData\Roaming\npm\node_modules\markmap-lib\dist\index.js:38:43) (node:528) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:528) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Layout bug for specific markdown

# dddd

## fruits
- fff

## ffff
- banana
- dddd
- mango
- melon
- orange

# fff
- f

Hi, the following markdown has buggy layout.

Passing the markdown file to transform method.

Hi,

I am trying to use Markmap in a browser app. If I have a .md file, is it possible to pass the file to the transform or does the file need to be parsed and then passed as a string to the transform?

import { transform } from 'markmap-lib/dist/transform.common';
const data = transform(markdown);

Is it possible to use markmap directly in html

Just like mermaid, I can simplily use it in html by code like this.

<head>
  <script src="https://cdn.bootcdn.net/ajax/libs/mermaid/8.8.2/mermaid.min.js"></script>
</head>

<div class="mermaid">
  graph TD
      Start --> Stop
</div>

feature request: buttons to extend and collapse

Hi, @gera2ld . Markmap-lib is very awesome. I love it. Thank you for developing such a software.

When I used it to render my lecture notes(4050 words), the extended mindmap was in a mess. It was difficult for me to read it.

DeepinScreenshot_select-area_20200728130133

I hope there will be buttons to extend and collapse different levels of nodes like baidu naotu.

deepin-screen-recorder_Select area_20200728125124

Collapsed map flag

Hello!

I love this tool!

Is there anyway to add a flag at runtime to render the map with all the branches collapsed by default? My maps launch with all branches expanded and they are rather large - is there anyway to flag --collapsed or something so the map starts with only root and all branches collapsed by default?

Error when running watch mode

When running markmap -w <input> I get the following error:

internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'chokidar'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/Users/galstep/.nvm/versions/node/v10.21.0/lib/node_modules/markmap-lib/dist/dev-server.js:20:40)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)

Markmap installed as global npm module

Support more than 9 levels

I found markmap for VSCode, and it's great. I found that it causes the problems, if the number of levels is greater than 9. I use it to draw a diagram for multi-level unordered lists, and it is more than 10 levels deep, that's why I found it.

An example (renders properly):

  • level 1
    • level 2
      • level 3.1
      • level 3.2
        • level 4.1
        • level 4.2
          • level 5
            • level 6.1
            • level 6.2
            • level 6.3
            • level 6.4
              • level 7
                • level 8.1
                  • level 9
                • level 8.2
                • level 8.3
      • level 3.3

obraz

Add level 10, and it renders with problems:

  • level 1
    • level 2
      • level 3.1
      • level 3.2
        • level 4.1
        • level 4.2
          • level 5
            • level 6.1
            • level 6.2
            • level 6.3
            • level 6.4
              • level 7
                • level 8.1
                  • level 9
                    • level 10
                • level 8.2
                • level 8.3
      • level 3.3

obraz

Render Mindmap with closed nodes

My question / request is between #14 and #32, but I want to tell the renderer to collapse nodes from my JS code in client side, instead of Markdown or a separate UI button.

Actually, I solved this for myself, setting the f property at every node before providing the data to the renderer (see the code below), but I think a global option would be nice at the transform or the render.

<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
    </head>
    <body>
        <svg id="mindmap" width="700" height="500"></svg>
        <script src="https://cdn.jsdelivr.net/npm/d3@5"></script>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/view.min.js"></script>
        <script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/browser/transform.min.js"></script>

            <pre id="mm" hidden>
# foobar

## foo

- f
- o
- o

## bar

- b
- a
- r
        </pre>
        <script>
            function rec(data) {
                data.p = {f: true};
                for (var i in data.c) {
                    rec(data.c[i]);
                }
            }
            markdown =  document.getElementById("mm").innerHTML;
            const data = markmap.transform(markdown);

            rec(data);
            markmap.Markmap.create("#mindmap", null, data);
        </script>
    </body>
</html>

feature request: option to render markdown file in the background

Hello, @gera2ld . Could you add options to keep markmap-lib rendering markdown file in the background?

When I write a markdown document and use markmap-lib to render it, I need to execute markmap myfile.md regularly to refresh the mindmap. It is kind of inconvenient.

I hope there will be option like --keep to keep markmap-lib running in the background to refresh the file. After using markmap-lib, use --quit to stop markmap-lib running in the background. It would be better if markmap can automatically quit after I close the html file and markdown file.

MathJax not working

Markdown file as follows,

# Separation

## Backward-facing Step

- Snoi_2017AIAAJ_TurbulentSupersonicBackwardFacingStep
  - OpenFOAM LES using an equilibrium wall model with $y^+=20$, 2nd order scheme, BDF2 with CFL<0.5.
    Relatively good match with the experimental data.
    Also do POD.
    I do not think this is a good paper.
  - $y^+=20$

Using the command markmap --no-open --enable-mathjax Separation_MindMap.md, it gives the following output, resulting in no MathJax rendered.

markmap

My markmap version is

$ markmap --version
0.6.0

Is it possible to suppoer some of markdown grammar?

Hi! Thank you for providing this fantastic program which did help me a lot on my study.

When I'm writing with markdown, I unconciously use those grammars to make my file look neater. Like using html label <font> to change face, color and size to emphasis the important. And also sometimes I need to add some graphs for easier understanding using![graph](path) .

I'm wondering if it is possible to support those features. If so, it would be great and powerful.

Thanks again for your contribution!

Unhandled Promise Rejection Warning.

Hi, when markmap file.md is executed the system reports this error:

(node:15195) UnhandledPromiseRejectionWarning: TypeError: token.children is not iterable
    at extractInline (/usr/lib/node_modules/markmap-lib/dist/index.js:29:29)
    at buildTree (/usr/lib/node_modules/markmap-lib/dist/index.js:202:25)
    at transform (/usr/lib/node_modules/markmap-lib/dist/index.js:212:14)
    at createMarkmap (/usr/lib/node_modules/markmap-lib/dist/index.js:241:16)
(node:15195) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:15195) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Can you fit any idea to fix it?
Regards and thank you for this tool, we look forward to using it.

type for features in `ITransformResult`

Currently the type looks like this:

export interface ITransformResult {
    root: INode;
    features: any;
}

As any is a undesired type (or lack thereof) I'd like to change this.
Looking at the usage of features in
https://github.com/gera2ld/markmap/blob/e944308c2272288ec5273098fb9de92001cab948/packages/markmap-lib/src/transform.ts#L175
the type of features seems to be { [key: string]: boolean; }.

So a solution could be to just do the following:

export interface IFeatures { [key: string]: boolean; }
export interface ITransformResult {
    root: INode;
    features: IFeatures;
}

and using IFeatures in all other appropriate locations.

can turn text body into note of the node in mindmap?

1

As for the "body", I mean everything which is not a title starting with #, but lies between to headings. For example

# heading 1

this is the body 1

## heading 1.1

As for the "note", you may find it in https://www.mindmup.com/

2

Why do I ask this? Because there is another question. Can we drag the node in the mindmap to re-arrange its order not only in mindmap but also in the markdown editor? If the mindmap can take note, then we can re-struct of the text in markdown easily.

Thanks

Feature Request: Nested links & network graphs

This is really great project. I have few suggestions for additional features.

  1. Support for nested links as in Markdown Mindmap.
- A
  - B
  - C
    - D
      - [E](test.md)

a
2. It would be great if it would work on anchor links as well.

- A
  - B
  - <a name='c'>C</a>
    - D
      - [E](test.md#c)

b

  1. I don't know if it could be placed in the scope of this project, but I would like to have the option to create networks graphs, instead of mindmaps. Mindmaps are great, but sometimes it would be good to visualize markdown as network (graph with cycles), so instead of creating infinite mindmap, visualization could create edge to node that already exist.
- A
  - B
  - <a name='c'>C</a>
    - D
      - E
        - [C](test.md#c) 

d

Feature Request: Add single `cell`, support more formats such as pictures, and support multiple theme options.

Hello, this project is very helpful. I like it very much, thank you for sharing.

I hope to add the following functions:

  1. Being able to set to display a single cell, the cell will not have any connection with other parts. Because I think there are sometimes such demands.
  2. Other files or links such as pictures can be displayed. Just like markdown files.
  3. Add a variety of themes to choose from. The most basic, I think, light and dark themes are needed.

Thank you. Thanks again for sharing.

Is it possible to change style of horizontal rule?

It would be nice to have a possibillity to change styles. Or chose from several at least. For example this simple style. Key feature of this style is that words are not underscored (nodes style isn't so important, as for me), I'm sure this kind of mind maps are easier to perceive.

Layout feature

This library is based on D3.js, so, is it possible to support more customization features, like line style, node style and layout ?

Could you add MathJax support ?

Hey, it's an awesome tool ! 👍

If it can support mathjax to render math symbols, equation, etc. , it would be better for taking science notes ! 😝

zoom svg and download html ?

I introduced the library you wrote through the script tag, I have not written TS code, to get your help, thank you.

  1. Which function is brain image zoom in and zoom out, and how to call it in the browser?

  2. Which function to download the HTML and how to call it in the browser?

**bold text** is broken

The bold text styling using **bold** is not working.

The bold font weight is being overwritten with font-weight: 500 by a different class in the css somewhere.

Error "Uncaught (in promise)" when loading prismJS plugin

Hi,
I've included your awesome lib inside an Angular 9 application.
When I load prismJS plugin as indicated in the API documentation, I get the following error:

ERROR Error: Uncaught (in promise): [object Undefined]
    at resolvePromise (zone-evergreen.js:798)
    at SVGSVGElement.<anonymous> (zone-evergreen.js:705)
    at Dispatch.call (dispatch.js:57)
    at start (schedule.js:88)
    at schedule (schedule.js:66)
    at timerFlush (timer.js:61)
    at wake (timer.js:71)
    at ZoneDelegate.invokeTask (zone-evergreen.js:399)
    at Object.onInvokeTask (core.js:41344)
    at ZoneDelegate.invokeTask (zone-evergreen.js:398)

Despite this, the map and the plugin work perfectly, but I wonder if there is a way to avoid this error message in the console.

The ⤧ symbol is unclear

Screenshot 2020-05-06 at 21 02 43

I was expecting this button to expand the canvas to the full screen and thought it's buggy. Only later I realized that it means "reset the zoom to 1:1". Maybe some different symbol could be used, like that magnifying glass with a plus/minus in it?

Error about style ?

Hello - I apologize if I am doing something wrong or have missed a step but I get an error when I run the command:

markmap CORE.md
/usr/lib/node_modules/markmap-lib/dist/index.js:39
style = { ...style,
^^^

SyntaxError: Unexpected token ...
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:549:28)
at Object.Module._extensions..js (module.js:586:10)
at Module.load (module.js:494:32)
at tryModuleLoad (module.js:453:12)
at Function.Module._load (module.js:445:3)
at Module.require (module.js:504:17)
at require (internal/module.js:20:19)
at Object. (/usr/lib/node_modules/markmap-lib/bin/cli.js:4:27)

Have I missed something?

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.