Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add parsing for timestamp syntax #23

Open
whacked opened this issue Feb 24, 2016 · 1 comment
Open

Add parsing for timestamp syntax #23

whacked opened this issue Feb 24, 2016 · 1 comment

Comments

@whacked
Copy link

whacked commented Feb 24, 2016

As far as I can tell, there is no timestamp syntax handling in the current version.

A variety are described in the 8.1 Timestamps, deadlines, and scheduling in the manual (as of 2016-02-24)

The document page does not show other formats like ISO 8601 and similar, though native org parses it as "clock time". Examples:

  • [2016-02-21 10:07:07-0500]
  • [2016-02-24]
  • [2016-02-24 Wed]
  • [2001-07-08 01:23:45]

Since the datetime cannot span more than one line, I am guessing this needs to be something like a Syntax.define("date"...) entry in https://github.com/mooz/org-js/blob/master/lib/org/lexer.js ?

The regex for schedule/deadline parsing in daiganio's org-mode-parser.js is here:
https://github.com/daitangio/org-mode-parser/blob/master/lib/org-mode-parser.js#L216-L217

The regex for "clock time" parsing for the same library is in https://github.com/daitangio/org-mode-parser/blob/master/lib/org-mode-parser.js#L226 (however, for org export, clock time does not need to be preceded with the "CLOCK:" string and can occur anywhere)

I am happy to give a try of adding a lexer / exporter entry for a simple version of this, but would like to know what you think.

In particular, if you want larger coverage, Timestamp with repeater interval and Diary-style sexp entries require additional processing after the regex match, so I don't know if my Syntax.define guess is correct.

Thanks!

@whacked
Copy link
Author

whacked commented Jun 6, 2016

master...whacked:2016-06_exploration has a rough cut of adding timestamp parsing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant