Commit Graph

103 Commits

Author SHA1 Message Date
Sergio Martínez Portela
570e6bb764 Implement OrgDoc .tags. 2024-09-01 23:35:33 +02:00
Sergio Martínez Portela
4af4cda44b Fix formatting. 2024-08-22 00:26:11 +02:00
Sergio Martínez Portela
5552b3324b Handle ] which not close link descriptions or references. 2024-08-22 00:21:02 +02:00
Sergio Martínez Portela
f31c64c242 Properly track which tokens are used for closing formats. 2024-08-22 00:20:54 +02:00
Sergio Martínez Portela
490b36887a Require space before list item tag separator. 2024-08-22 00:20:15 +02:00
Sergio Martínez Portela
e991074346 fix: Apply import sorting. 2024-08-18 22:49:33 +02:00
Sergio Martínez Portela
8ca480ad77 fix: Apply black formatter. 2024-08-18 22:47:24 +02:00
Lyz
75055f5e08
feat: enhance type annotations and formatting
All checks were successful
Testing / pytest (push) Successful in 27s
Testing / mypy (push) Successful in 34s
Testing / stability-extra-test (push) Successful in 28s
feat: Added `py.typed` file to indicate the presence of type information in the package.

Mypy needs this
2024-08-02 20:08:04 +02:00
Sergio Martínez Portela
09f9030818 tests: fix typings to match mypy expectations. 2024-07-29 15:31:39 +01:00
Sergio Martínez Portela
7e44bce145 Merge remote-tracking branch 'origin/develop' into feat/add-todo-keywords-programmatically 2024-07-29 15:19:58 +01:00
Sergio Martínez Portela
b174405c90 Refactor headline state parsing.
- Add separate function to parse states.
- Handle edge case when no `|` is used to split TODO and DONE states.
- Add typing to the states to future-proof for handling keyboard shortcuts and actions on state changes.
2024-07-20 18:10:05 +02:00
Sergio Martínez Portela
da2d8c8c6d Add org-todo-keywords environment to programatically set states. 2024-07-20 14:42:41 +02:00
Lyz
ff841f82f0
feat: Set the default Timestamp active to True
That way you don't need to specify it if you don't want
2024-07-20 11:41:15 +02:00
Lyz
be68d10d7a
feat: initialise a Timestamp from a datetime object 2024-07-20 11:38:19 +02:00
Lyz
f640521b56
feat: add the scheduled, deadline and closed arguments to Headline init
style: Improve the type hints of Time

When reading them it's more natural to read Optional[Time] than to
assume that None is part of the Union in Time
2024-07-20 11:14:15 +02:00
Lyz
694f3f59e2
Merge branch 'develop' into feat/improvements 2024-07-20 10:49:06 +02:00
Lyz
c5cc14f65c
feat(Timestamp): add the from_datetime method
To update the current Timestamp instance based on a datetime or date object.

I've also included a set_datetime method to OrgTime

feat: add activate and deactivate methods to TimeRange and OrgTime

I need it in a program I'm making
refactor: Create the Time type hint

I had to move the parse_time and parse_org_time_range below OrgTime
because it used the Time type hint and the Time type hint needed the
other two

style: reformat the code following black

style: Add some type hints and docstrings

style: remove unused imports

tests: Correct some mypy errors
2024-07-19 21:36:00 +02:00
Sergio Martínez Portela
423d6f9842 Fix multiline specifications of TODO properties. 2024-03-22 01:54:46 +01:00
Sergio Martínez Portela
9e994ba323 Accept numbers as end of implicit link. 2024-02-21 23:01:10 +01:00
Sergio Martínez Portela
4fd29819ea Fix implicit link parsing. 2024-02-21 23:00:59 +01:00
Sergio Martínez Portela
985098e091 Find web links not marked as such when returning doc.get_links(). 2024-02-04 00:18:31 +01:00
Sergio Martínez Portela
e26a2f04ac Fix typing of headline_hierarchy, remove incorrect assertion. 2023-10-16 23:38:54 +02:00
Sergio Martínez Portela
e4821f02cd Fix: run checks on the updated headline_hierarchy. 2023-10-16 23:16:41 +02:00
Sergio Martínez Portela
1d0b4cce14 Complete typing with mypy --check-untyped-defs. 2023-10-16 00:21:30 +02:00
Sergio Martínez Portela
343d864559 Fix handling of headline title-tags separated by tabs. 2023-10-15 16:39:00 +02:00
Sergio Martínez Portela
5ed34df57a Make typed functions pass mypy check. 2023-10-15 16:34:33 +02:00
Sergio Martínez Portela
2749a5caad Implement Headline.add_tag()/.create_headline_at_end(). 2023-10-07 13:14:13 +02:00
Sergio Martínez Portela
f11ecd05d6 Fix: find links in list tags. 2023-07-30 23:16:04 +02:00
Sergio Martínez Portela
36a0a00113 Fix nested lists DOM generation and add tests. 2023-05-01 20:40:02 +02:00
Sergio Martínez Portela
790ef57598 Add extra check for TimeRange validity. 2023-04-23 20:50:06 +02:00
Sergio Martínez Portela
302689a622 Fix dom generated of table nested into list. 2023-04-23 20:50:06 +02:00
Sergio Martínez Portela
7008124509 Use more robust list de-indentation handler. 2023-04-13 23:56:58 +02:00
Sergio Martínez Portela
d67bae645b Fix string representation of PropertyNode. 2023-01-04 00:36:20 +01:00
Sergio Martínez Portela
8832cd0b3d Fix extraction of block element contents.
Don't confound normal characters with formatting markers. Handle escaping of
    otherwise headline starters with a comma.
2022-11-17 00:20:20 +01:00
Sergio Martínez Portela
66d061dfda Expose #+BEGIN_ block arguments. 2022-11-15 21:11:05 +01:00
Sergio Martínez Portela
b819904457 Fix handling of block elements after multiline list items. 2022-11-12 18:01:19 +01:00
Sergio Martínez Portela
6c6c375572 WIP: Add support for multiline list items.
Right now this messes with line numbers.
2022-11-12 12:40:57 +01:00
Sergio Martínez Portela
ccebe90ea8 Fix as_dom of Text found in a result after a list. 2022-11-04 00:14:41 +01:00
Sergio Martínez Portela
bf10c51e61 Indent list-group inside current node if part of a block. 2022-11-04 00:14:41 +01:00
Sergio Martínez Portela
28ddd3e44f Support get_raw_contents of list groups. 2022-11-04 00:14:41 +01:00
Sergio Martínez Portela
440f0bd4b7 Properly fix parsing of lists inside drawers. 2022-11-01 19:58:17 +01:00
Sergio Martínez Portela
fc9ce664ae Unify drawer node classes under a common parent. 2022-11-01 19:58:03 +01:00
Sergio Martínez Portela
d1d5de89b7 Revert "Fix parsing of lists inside drawers."
This reverts commit 5e4a9f8ff2.

The tree should not be modified, as it's the returned value. We need an
     additional tree for parent-child element connections.
2022-11-01 19:14:14 +01:00
Sergio Martínez Portela
5e4a9f8ff2 Fix parsing of lists inside drawers. 2022-10-31 21:50:18 +01:00
Sergio Martínez Portela
2748f6400b Make token_list_to_plaintext skip link's URL. 2022-10-21 20:14:57 +02:00
Sergio Martínez Portela
7beec0be05 Fix link building on text_to_dom. 2022-09-29 23:24:20 +02:00
Sergio Martínez Portela
3dc6213abb Handle list items where the tag is composed only by the checkbox. 2022-09-29 20:32:26 +02:00
Sergio Martínez Portela
d69bf97163 Require whitespace after list bullet. 2022-09-29 20:25:48 +02:00
Sergio Martínez Portela
28d8b69146 Export table on as_dom. 2022-09-27 23:55:07 +02:00
Sergio Martínez Portela
c2968283f3 feat: Add base support for tables. 2022-09-27 23:36:32 +02:00