Giter VIP home page Giter VIP logo

Comments (4)

hrehfeld avatar hrehfeld commented on May 28, 2024 2

Hm, I see.

@hrehfeld for documentation, do you mean in orgparse, or in the inorganic library I mentioned above?
I mainly need full round-trip org-mode parsing, i.e. parse the file, change something, write back the changes. So.. a separation doesn't really make that much sense here other than to keep reading/writing separate.

For orgparse, I guess the main issue that the original author of library (and me) didn't have this in mind, so the 'ast' is geared towards single pass document reading. It's also possible to take the document object tree and modify it... but writing back might be a bit more complicated, although doable. I just didn't have many usecases for it so far.

my usecase is definitely:

root = orgparse.parse('myfile.org')
root.title = 'Look Ma, I changed the Title!'
orgparse.dump(root, 'myfile.org')

from orgparse.

karlicoss avatar karlicoss commented on May 28, 2024 1

Hey, I actually do have a small library, inorganic to write org-mode files and you can see examples in doctests and in orger library. I implemented this in a separate library because want to understand what would be a good API first. So let me know if inorganic works for you and I'd be curious about your usecase, so I could think of a convenient interface!

from orgparse.

hrehfeld avatar hrehfeld commented on May 28, 2024

Is there any reason why there's no documentation on constructing nodes? It seems that roundtrip even with complex files works flawflessly, the only part that is missing is how to construct the ast by hand?

from orgparse.

karlicoss avatar karlicoss commented on May 28, 2024

@hrehfeld for documentation, do you mean in orgparse, or in the inorganic library I mentioned above?
For orgparse, I guess the main issue that the original author of library (and me) didn't have this in mind, so the 'ast' is geared towards single pass document reading. It's also possible to take the document object tree and modify it... but writing back might be a bit more complicated, although doable. I just didn't have many usecases for it so far.

from orgparse.

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.