Hi!
It would be nice if ReST Editor could show also '..topic' elements in the outline. These elements are usually quite big and I think most users would like to see them in the outline along with the headings.
I could try to add this feature myself if you gave me some pointers about what files to dig in first. (I've done some Eclipse development before.)
Hi,
It has been a long time since I last worked on ReST Editor, but thanks for using it ;)
Sadly, I don't have enough time to work on this project for now (Thesis, iPOPO project, etc)...
Also, if I decide to get back on the project, the first thing I want to do is to write a proper ReST parser.
The current one doesn't give enough information nor power on the document, and prevents writing cool features like content-assist for specific directives (image files, references, ...).
But here are some hints if you want to implement the "topics" feature :
Offsets are used to move in the document when clicking on the outline.
I think the best way to implement this feature is to create a second element to the top of the outline tree, i.e. add a "Topic" element beside "Document".
This can be done in the SectionContentProvider class, in getElements(), returning two elements instead of one, and adding utility methods.
Do not change the getRoot() method to avoid the "normalization of sections" to be applied on topics.
The content of Outline is generated by SectionContentProvider.inputChanged().
For topics, you should do the job in the "for(... : allPartitions)" loop, looking for the RestPartitionScanner.LITERAL_BLOCK partition type.
There, you will have to create a TreeData object, like storeSection() does, except that you won't have to detect the section decoration and hierarchy (i.e. with 50% less code).
Finally, you will have to add a test in HierarchyAction.run() to avoid moving topics.
This action may work if you provide TreeData objects with correct offsets, but I can't guarantee that.
There are other ways to do the job, like interlacing topics and sections, but they might need deeper modifications.
Hoping it will help you
Cheers,
Thomas
Hi,
It has been a long time since I last worked on ReST Editor, but thanks for
using it ;)
Sadly, I don't have enough time to work on this project for now (Thesis,
iPOPO project, etc)...
Also, if I decide to get back on the project, the first thing I want to do
is to write a proper ReST parser.
The current one doesn't give enough information nor power on the document,
and prevents writing cool features like content-assist for specific
directives (image files, references, ...).
But here are some hints if you want to implement the "topics" feature :
package
Outline page, from a SectionContentProvider
objects.
begin and end offsets in the document.
Offsets are used to move in the document when clicking on the outline.
I think the best way to implement this feature is to create a second
element to the top of the outline tree, i.e. add a "Topic" element beside
"Document".
This can be done in the SectionContentProvider class, in getElements(),
returning two elements instead of one, and adding utility methods.
Do not change the getRoot() method to avoid the "normalization of sections"
to be applied on topics.
The content of Outline is generated by
SectionContentProvider.inputChanged().
For topics, you should do the job in the "for(... : allPartitions)" loop,
looking for the RestPartitionScanner.LITERAL_BLOCK partition type.
There, you will have to create a TreeData object, like storeSection() does,
except that you won't have to detect the section decoration and hierarchy
(i.e. with 50% less code).
Finally, you will have to add a test in HierarchyAction.run() to avoid
moving topics.
This action may work if you provide TreeData objects with correct offsets,
but I can't guarantee that.
There are other ways to do the job, like interlacing topics and sections,
but they might need deeper modifications.
Hoping it will help you
Cheers,
Thomas
2014/1/16 Aivar Annamaa aivarannamaa@users.sf.net
Related
Bugs: #13