#13 Add possibility to show "topic"-s in outline

1.0.x
open
nobody
None
1
2014-01-16
2014-01-16
No

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.)

Discussion

  • Thomas Calmant

    Thomas Calmant - 2014-01-16

    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 :

    • Everything is done in the "org.isandlatech.plugins.rest.editor.outline" package
    • RestContentOutlinePage gives to Eclipse the content to display in the Outline page, from a SectionContentProvider
    • SectionContentProvider is in fact the description of a tree of TreeData objects.
    • TreeData simply contains the text to be displayed (topic name) and its 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

     
  • Thomas Calmant

    Thomas Calmant - 2014-01-16

    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 :
    - Everything is done in the "org.isandlatech.plugins.rest.editor.outline"
    package
    - RestContentOutlinePage gives to Eclipse the content to display in the
    Outline page, from a SectionContentProvider
    - SectionContentProvider is in fact the description of a tree of TreeData
    objects.
    - TreeData simply contains the text to be displayed (topic name) and its
    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


    Status: open
    Created: Thu Jan 16, 2014 03:16 PM UTC by Aivar Annamaa
    Last Updated: Thu Jan 16, 2014 03:16 PM UTC
    Owner: nobody

    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.)


    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/resteditor/bugs/13/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/subscriptions/

     

Log in to post a comment.