GEPS 022: Narrative Website Refactor

From Gramps
Jump to: navigation, search

This page documents a proposal to refactor Narrative Website into more manageable parts, and to create a more solid foundation going forward.

Narrative Website

Issues:

  1. Narrative Website (NarrWeb) is a very popular Gramps report among Gramps users
  2. NarrWeb perhaps has more reported bugs and issues than any other component of Gramps
  3. NarrWeb should give a complete and accurate rendering in a web browser, which has many complexities
  4. The size and complexity of the NarrWeb code has grown considerably since its initial version
  5. People consistently want NarrWeb to do even more
  6. NarrWeb is now monolithic and has many interacting, brittle parts
  7. There are needs for new features (such as object linking from notes) that require changes in NarrWeb
  8. There is a need for a way of connecting other web reports (such as WebCal) onto NarrWeb
  9. It would be good to create parts that can be re-used in gramps-connect

Because of these issues, a refactor is proposed. The main goals are:

  1. Break NarrWeb into manageable parts, each of which can be tested, refined, and replaced
  2. Move the complex, standard parts into a core that doesn't change as much, separate from more dynamic code
  3. Move to a two-pass, component driven process
  4. Reuse the Report plugin infrastructure for sub-components

Proposal Details

The main goal of the refactor is to move each major part of NarrWeb into its own Web Report that can be run as a stand-along webreport, or as a sub-report of the refactored NarrWeb.

The refactored NarrWeb shall be referred to as WebSite, and can incorporate any other Web Report into a comprehensive web site.

For example, all of the following would be independent Web Report plugins:

  1. Homepage
  2. Person List
  3. Place List
  4. Family List
  5. Download
  6. Note List
  7. Calendar

Because these reports can be run stand-alone (ie, not from WebSite) they can be tested independently.

In addition, third-parties can create additional Web Reports that can be included to be run stand-alone or as an integrated page from WebSite.

Website will contain all of the common functions needed when reports are run together. There may need to be a library for common functions when reports are run standalone.

Users will select what sub web reports they wish to include. (It would be very handy here to have "named settings" for creating different kinds of websites. However, this is a Feature Request that others have asked for for other plugins as well, and is not covered here.)

When as user selects a sub web report for inclusion, a Options Page will appear. Users can then set the options for the sub web report.

Each sub report will be responsible for the following:

  1. Collect its own data (but stored in a common place)
  2. Handle its own options
  3. Create its own pages

Perhaps the same WebSite options will be necessary for each sub report when running the sub report in stand-alone mode.

Other Issues

It has been noted that NarrWeb currently uses some non-standard functions, and does not fully use the HTMLDoc Backend. These types of issues will be more fully addressed after the refactor.


See also