Giter Club home page Giter Club logo

bartfeenstra / betty Goto Github PK

View Code? Open in Web Editor NEW
65.0 65.0 10.0 5.12 MB

Betty visualizes and publishes your family history by building interactive, encyclopedia-like genealogy websites out of your Gramps and GEDCOM family trees

Home Page: https://betty.readthedocs.io

License: GNU General Public License v3.0

Shell 0.38% Python 90.74% JavaScript 1.00% CSS 0.03% Jinja 5.15% SCSS 1.09% Dockerfile 0.01% Lua 0.34% TypeScript 1.25%
ancestry betty docker family-tree gedcom gedcom-files genealogy gramps gramps-xml static-site-generator

betty's People

Contributors

bartfeenstra avatar dependabot[bot] avatar patlx avatar rainerth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

betty's Issues

Sort page-level citations

On any page, citations are numbered, with the numbers being specific to that page (the first citation being 1, but that same citation may be the fifteenth on another page). However, as the following example shows, when citations are rendered for a specific claim, they are not sorted by number:

 Birth of Lankester, David Marinus
May 5, 1847 in Vlissingen [27] [28] [15] [29]

Clean private people

Clean private people without non-private descendants. They do not provide any linkage between non-private people.

Simplify plugin definitions in configuration files

Now plugins can declare before or after which other plugins they come, we can simplify configuration files by making plugin configuration a dictionary, keyed by plugin name, and with each plugin's configuration as values. The current list was introduced to ensure order, but we do not use that anyway.

Document HTTP OPTIONS support

If we want nginx to support HTTP OPTIONS request, add the following:

if ($request_method = OPTIONS) {
        add_header Allow "OPTIONS, GET";
        return 200;
}

Add start-of-life and end-of-life shortcuts

Persons now have shortcut methods for their births and deaths, and we use those in our templates. Instead, we should have shortcuts for start-of-life (birth, baptism, other?) and end-of-life (death, burial, other?) events. We should probably also move these shortcuts from our models to the templating layer.

Make nginx configuration configurable for deployments

Allow the nginx plugin to use an alternative www_directory_path so the root directive will no longer have to be hackily replaced after site generation if the site is deployed to another system.

Similarly, allow an explicit configuration setting to deploy the Betty nginx configuration as an upstream backend behind a proxy. This means disabling HTTPS.

Test the nginx configuration

Add a functional test for the nginx configuration. We can use a Docker container to run nginx in a platform-independent way.

Introduce references

To give credit where credit is due, we must introduce references. Gramps supports citations, sources, and repositories, and I am wondering if we can group those in a generic references data type, where we allow a hierachy between references. One references can then be a volume in an archive, which itself is a references within a larger organization or archives.

To get an idea of what we must support, possible references types, or properties of possible references types:

  • People (real-life or virtual, with contact information)
  • Online organizations
  • Physical buildings (should we use Place references?)

Ancestry trees render missing names as "null"

Ancestry trees should not render missing names at all, but render them as "null" now. Instead, maybe add rendering functions for sortable (Doe, John or ..., Jane) and isolated (John Doe or Jane) for use in different contexts.

Use HTTP 301 redirects

Use HTTP 301 instead of 307 redirects when handling requests for unspecified locales in nginx.conf.j2.

Make the current CLI a subcommand

The CLI currently acts as one command. If we instead make this a subcommand, such as betty generate ..., we open up the possibility to add new subcommands in the future without having to break BC then.

Test on Node.js 12

Change the 'latest' test run to be on Node.js 12, and add a separate test run for Node.js 10.

Test on Python 3.8

Change the 'latest' test run to be on Python 3.8, and add a separate test run for Python 3.7.

Classed events

Currently events are strings, and event parameters are zero or more values passed on when invoking the dispatcher.

Instead, if we turn events into classes extending a new Event class, we can introduce new functionality without breaking BC, such as propagation control, and additional parameters.

Split generation out per content type

Move generation to plugins, and let plugins expose generators. A genrator can output public data and ahould then define a content define the formats (content types, etc) they can generate. By default we ship with a plugin that generates text/html, but we can later add others, such as application/ld+json , or even one for nginx configuration.

Cache Wikipedia responses

Cache Wikipedia responses based on the HTTP Response Cache headers.This reduces traffic increases build performance.

Missing read permissions

Some files have insufficient read permissions locally, and those are kept when rsyncing them to the server, causing them to be inaccessible to the public. The deploy script must set these permissions itself.

Move the footer to its own template

Move the footer to its own template, so when sites want to override it, they won't have to chase changes to the base template all the time.

Do not privatize people without children but whose ancestors are old enough

We now privatize people unless we can determine they or at least one of their descendants have been dead for at least 125 years.

This means we still privatize people who have long since been dead.

Additionally, also check if people's ancestors have been dead for enough time, and if so, do not privatize them. Example: If someone's parents have been dead for N125 years, or their grandparents for 2N250 years, or their great-grandparents for 3N*125 years(, etcetera), do not private that person.

Find a good value for N. In practice, if someone's parents have been dead for 125 years, they themselves have probably been dead for 75-100 years already as well.

Semantic metadata

Site-level

These may require us to provide Betty with a site configuration file containing the metadata to render.

  • Authorship (#279)
  • License
  • robots.txt (#31)
  • Sitemap (#31)

Resources

  • <time> for Date objects with year, month, and day components (#69)
  • FOAF for people (#85)
  • <address> for places (#70)
  • Purl for places
  • JSON-LD (#256)

Facebook

Twitter

Introduce resources

#25 shows we want features that require we know more about the resources (pages) we render:

  • Created time
  • Last modified time (rendered time?)
  • Media (images, are other types relevant?)
  • Authors

We can create a resource object when starting the rendering process of a new page, give templates read/write access, and destroy it once the process ends.

Can we keep a record of all rendered resources, so static assets such as the sitemap can inspect them?

Development/production mode

Add a mode (development/production), to bet set in the config file, and perhaps in the CLI. We should also pass this on when invoking node.js modules. Tools like webpack can choose (not) to optimize their builds based on this setting.

Make all URL generators classes

Betty now has one main UrlGenerator class. Turn this type into an interface, and create three implementations:

  • PathUrlGenerator to replace UrlGenerator._generate_for_path.
  • IdentifiableUrlGenerator to replace UrlGenerator._generator_for_identifiable.
  • 'DelegatingUrlGeneratorto replace the delegating functionaly ofUrlGenerator.generate`

Clean up HTML titles for pages without titles

Pages without titles result in HTML documents having titles consisting of a separator and the site title, i.e. - Jane's ancestry. We should remove the separator if there's no page title, such as Jane's ancestry.

Add people to events

Reference people from events. Verify if this is a zero-or-more or a one-or-more relationship. Also see if we can and want to limit the maximum number of people for certain event types. Primary/inevitable life events such as birth and death apply to a single person only, while other events are between people, such as marriages.

Introduce plugins

  • Can be enabled and configured in the configuration file
  • Respond to events

Allow JS providers without needing Node.js

Currently the only way to add additional JS is to write a plugin that depends on the Js plugin, and that includes its own JS entry point. This requires a third-party dependency that may not be available, and involves considerable complexity for something that should be really simple.

Can we instead come up with a solution that lets plugins simply expose their JS files?

Add i18n and l10n

Definition of done

  • Allow Betty to be configured to use one or more locales.
  • Consider whether a default locale should be used.
  • Allow user-facing strings to be translated.
  • Allow dates to be formatted according the configured locale. Keep in mind while in practice Betty has only been used with Gregorian dates, date parts (days, months, years) may be missing, and in the future support for different calendars may be required.
  • Consider whether it is a good idea to avoid all-numeric date formats (YYYY-MM-DD, DD-MM-YYYY, or the American MM-DD-YYYY) altogether to avoid confusion.
  • For non-clean URLs, add the language to the URL.
  • For clean URLs, allow content negotiation by the web server.
  • For clean URLs, allow users to specifically request a particular language without using content negotiation as well.
  • Update the generated nginx configuration to reflect this functionality.
  • Update the <html> tag.
  • Ensure JavaScript uses the <html> tag to read the document's language, and displays strings in the correct one.
  • Allow plugins and sites to provide extra translations located in their resources directories.
  • Extend the sitemap with localized URLs.
  • Localize betty.webmanifest.

Add a URL generator

With a generic URL generator, calling code will not have to know what kind of resource they are dealing with, and what paths to use. An example of what this lets us do, is to list all references (which can come from different types of resources) on citation pages.
This should also ensure clean URLs have trailing slashes.

File overrides and specificity

In order for users and plugins to override parts of the content that are generated, introduce a file management solution that supports the following primary features:

  • When looking for a file, allow multiple names to be suggested, ranging from more specific to less specific, such as person-P0001.html.j2 and person.html.j2. This allows overrides for specific content, and fallbacks for general usage.
  • When looking for a file, or when copying entire trees, allow multiple source directories to be suggested, ranging from more specific to less specific. This allows plugins and end users to override resources such as images and templates, and to provide resources that are more specific than what the core package provides (see the previous primary feature)

Introduce configuration exceptions

We currently rely on the jsonschema module for global configuration. However, most configuration comes from plugins, for which no validation exists.

Instead, introduce a generic ConfigurationError that can be raised, and replace the current JSON Schema-based validation with Python-based checks.

Allow CSS providers without needing Node.js

Currently the only way to add additional CSS is to write a plugin that depends on the Js plugin, and that includes its own JS entry point which in turn imports its own CSS file(s). This requires a third-party dependency that may not be available, and involves considerable complexity for something that should be really simple.

Can we instead come up with a solution that lets plugins simply expose their CSS files, and where we merge it into the core package's betty.css?

Assign Gramps family events to the correct people

Gramps allows events to be assigned to families, while these events are actually for specific individuals (marriages, divorces, etc). As a consequence, marriages are now rendered between all family members, for example.

Find a way to determine which individual people family events are for, and implement that in _parse_family().

Add render caching

To prevent expensive operations from slowing down rendering, allow configuration files to specify a caching directory. This can be used for image manpulations and #144, for instance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.