Coder Social home page Coder Social logo

Comments (12)

jgm avatar jgm commented on May 30, 2024

When you say it "does not work," what do you mean?
This gives me a djot document as output:

pandoc MANUAL.txt -t json -s | djot -f pandoc -t djot

Are you doing something different from that?
The document won't contain metadata, because djot has no metadata yet.

from djot.js.

tbdalgaard avatar tbdalgaard commented on May 30, 2024

from djot.js.

jgm avatar jgm commented on May 30, 2024

This gave some interesting errors.

It's more helpful if you actually give the errors. I tried it and in this case it's

Error: TypeError: Cannot read properties of undefined (reading 'DefaultDelim')
TypeError: Cannot read properties of undefined (reading 'DefaultDelim')
    at PandocParser.fromPandocBlock (/opt/homebrew/lib/node_modules/@djot/djot/lib/pandoc.js:732:54)
    at /opt/homebrew/lib/node_modules/@djot/djot/lib/pandoc.js:605:33
    at Array.map (<anonymous>)
    at PandocParser.fromPandocBlock (/opt/homebrew/lib/node_modules/@djot/djot/lib/pandoc.js:604:43)
    at /opt/homebrew/lib/node_modules/@djot/djot/lib/pandoc.js:850:25
    at Array.map (<anonymous>)
    at PandocParser.fromPandoc (/opt/homebrew/lib/node_modules/@djot/djot/lib/pandoc.js:849:34)
    at fromPandoc (/opt/homebrew/lib/node_modules/@djot/djot/lib/pandoc.js:863:38)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/@djot/djot/lib/cli.js:175:43)
    at Module._compile (node:internal/modules/cjs/loader:1218:14)% 

Is that what you saw? That points to a bug in djot's pandoc conversion, which should be rather easy to fix.

I had no trouble converting from docx, but if you did stumble across an error, please report it with full details and ideally a minimal docx we can use to reproduce it.

None of this has to do with metadata, I think.

from djot.js.

tbdalgaard avatar tbdalgaard commented on May 30, 2024

from djot.js.

jgm avatar jgm commented on May 30, 2024

I suspect the fix I just pushed will take care of this issue, but it's hard to tell unless you can give us a file that suffices to reproduce it.

If you have a git clone of this repository you can try

$ git pull
$ npm install -g .

and see if that helps.

from djot.js.

tbdalgaard avatar tbdalgaard commented on May 30, 2024

from djot.js.

jgm avatar jgm commented on May 30, 2024

A Danish version would be just fine.

from djot.js.

tbdalgaard avatar tbdalgaard commented on May 30, 2024

from djot.js.

jgm avatar jgm commented on May 30, 2024

This converted without errors using

pandoc ~/Downloads/vers1.html -t json -s | djot -f pandoc -t djot

If it doesn't work for you, then probably you aren't running the development version of djot.

from djot.js.

tbdalgaard avatar tbdalgaard commented on May 30, 2024

from djot.js.

jgm avatar jgm commented on May 30, 2024

I'm guessing you have a <section> with an id, and the first element of the section is a heading like <h2> with an id. Both are given here, but the second will take precedence. Sections are implicit in djot.

from djot.js.

tbdalgaard avatar tbdalgaard commented on May 30, 2024

from djot.js.

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.