Multilinear text browser
npm install textbrowser*Please note that this project, while now preliminarily functional,
is in its early stages. It is currently unstyled, Chromium-only, and
potentially intimidating to those unfamiliar with how to work it. There are
also some bugs to iron out such as with localization.*
See the web app within an app using TextBrowser
or see some videos introducing the app. For use with shortcuts,
see the video
at 5:25.
TextBrowser supports power-user browsing of arbitrary multi-linear
texts following the "offline first" motto.
The splash page for the texts is an internationalized interface
that allows for selection by the user of their desired interface language,
followed by a screen to choose from among designated texts, with each text
being given its own page to allow browsing of the contents of the text.
The text interface offers fine grained control to the user for how they
wish the output of that text to be displayed, both in terms of styling and
positioning, with its features particularly shining with multilinear/parallel
texts (e.g., multiple translations or commentaries that one views
side-by-side), allowing columns to be displayed in separated columns and/or
interlinearly (one verse vertically beneath the corresponding alternate).
Despite the name of the project referring to "text", this project
can be used for browsing any tabular data with sequential items.
It is designed to run solely with client-side JavaScript with the intent
that the web software will be able to work fully offline in the browser
as well as online. Currently, it must be run on a server though any static
server will do (it comes with a script to run the code on a simple Node.js
static file server--which can be easily set up on a local machine as well).
(It can't be run from a file:// URL (at least in Chrome), however, due to
more recent browser-added file access restrictions in such an environment.)
The syntax used in the code currently only works in a modern browser and
to date has only been tested in Chrome.
The following are user-facing features/goals:
- Have the interface be fully internationalized (i18n) to support translation The following are administrator-facing features/goals: - Allow most functionality to work for administrators out of the box via a The following are third-party-site-facing features/goals: - The thorough use of query strings (even to customize the work selection The following are TextBrowser-developer-facing features/goals: - Strong separation of concerns, with "design logic" separate from The repository is intended to be used as a Run the following from your project root. `` The following instructions are aimed at those adding TextBrowser as a If you would like to see a sample package implementing the Projects derivative to TextBrowser will need to adhere to the following: 1. Add the TextBrowser dependency per the Installation 1. Prepare JSON data files, JSON Schema files, and JSON meta-data files 1. Prepare JSON files to indicate the specific grouping of files you wish 1. Create an HTML page (see index-sample.html The recommended project directory structure (which are used by default by the - package.json - Should indicate The sections below begin with where you can find the JSON schema which One meta-property shared among The specific works adhere to particular schemas. See textbrowser-data-schemas. Besides the JSON files directly representing your works, you will need the #### This format is defined by this. It allows you to point the application to the data files you desire for The optional string properties The As with other files, there is also a The Its keys are plug-in names and whose value objects have the required property See Plugin Format for the structure of the plug-in pointed The - #### Although we hope you may contribute back to our project any project-independent TextBrowser comes with the If you need to implement your own, the properties include the string As with other files, there is a The locale files referenced by the Locales are an object of keys (which may be strings, arrays of strings, or Note that localization of specific file names and content, specific file #### (This file is not yet fully utilized in the app) This file expects a top-level As with other files, there is a Plugin file designated within - A number of properties are passed to multiple plug-in methods: - While some mechanisms exist to escape HTML, there are nevertheless some means The following indicates the JavaScript options that can tweak your See - new TextBrowser(options) - Constructor which takes an options object - - - - - - - - - - - - - - - - - - - As per semantic versioning used by The rest of the API used internally is unstable and should not be relied - This user JSON follows the user-json schema. The - 1. Progressive web app? / Electron? 1. Waiting (JSON UI Schema 1. Build "Preferred language(s)" to use awareness of content languages rather 1. Use i18nizeElement? (probably If you instead merely wish to test the current repository, you can: 1. Clone the repository. Note, however, that we may periodically Note, however, that much of testing will depend on a particular If you merely wish to see the app running in a server, you can run: If you do not wish to automatically open a tab each time the command is You can also use this latter option to run the browser tests PRs are most welcome, including for additional languages/locales. Tests will ideally be run before submission of a PR. At present we only have schema validation and lack UI and unit Note that we hope to create an extensible plug-in system, so One PHP/MySQL-based version was released in 2005-12-22 and was my It was hosted at On Bahá'í Libary Online, the Web Archive indicates its presence as far back - It was broken (or offline) for long periods of time after an upgrade of PHP This initiative is associated with the
into other languages and well localized (l10n) into such languages,
including for right-to-left languages. Internationalization even
optionally applies to parameter names, though this functionality
(and some other i18n features in general are not thoroughly tested at
present).
- Allow texts to be grouped on a work selection page with separate
introductory messages for each work.
- Allow browsing by a range of verses
- Allow browsing by alternate mechanisms (e.g., by different ordering schemes
on the same text)
- Allow precise and canonical pointing to a specific row or even cell
within a work (designation of anchors) by graphical means (without the
user needing to dig through HTML).
- Provide enumerated choices as pull-downs and numeric choices within
numerically-aware input fields (including for max and min values).
- Ability to selectively disable any column
- Ability to reorder (and even repeat) columns
- In addition to parallel text functionality where different translations,
commentaries, etc. are assigned their own separate columns in the results
table, allow users to designate that any field have any other field(s)
repeating within its cell (i.e., interlinear as opposed to parallel
display). Also provides a styling option on whether to repeat column
names and the option to style them (currently, the administrator can
also choose exactly how to separate these within cells from one another,
but we hope to provide user-facing preselected choices in the future).
- Allow categorization of content by language so that users can quickly
enable only such content languages in which they are interested
- Allow user to not only bookmark/share links of the results page and even
of a particular view of the work page. Functionality should be
available as much as possible via URL parameters.
- Allow column-specific styling
- Allow generic page styling of text, as form controls or CSS for
experienced users.
- Allow fine-grained control of the table display beyond border styling
(e.g., whether to show a caption summarizing the work/selection, whether
to show a header and if so, whether it should be fixed and/or styled, or
or whether the "table" is even an HTML table or instead HTML 's,
etc.--JSON export is hoped for the future).
- Ease of navigation within a site (as via breadcrumbs) and accessibility
(e.g., for the visually impaired) is also desired, but we are hoping
for expertise to provide a review and ideally assistance. We do have
some code begun internally.
declarative style (via well-used and readable JSON files) without need
for custom scripting. Though the project originated to meet the need of
Bahá'í texts, any document and even data with sequential fields
that can be put into a tabular structure can be browsed.
- Allow for translations within separate locale files
- Allows for easy conversion of table structures (e.g., SQL, JSON) into our
simple JSON array format
- Allow for standard means (as with our use of
JSON Schema)
to designate type information that can be used by the program for
automated display as well as optimization. Where a standard means
does not exist, we provide a declarative meta-data file to house
this information.
- It is a goal for us to support plug-ins for extensibility, including
declarative specification without need for scripting, but such support
is currently lacking (though some work internally has begun).
- It is a goal for us to support declarative means for indicating site
hierarchy and navigation. This is not implemented, but we do have some
code begun internally.
page as well as the results page) allow for other tools to more easily
tap into our API, and the control of styling (including of whether to show
table headers) deliberately allows for third-party sites to embed
content directly from TextBrowser-driven sites (including sites which
might wish to provide up-to-date, proofread, canonical sources of data
without duplicating or introducing the possibility of copy-paste error).
Blogs, discussion forums, and wikis might, for example, provide widgets
(a popup to our site especially once we may have implemented our to-do
for canonical syntax selection available through postMessage?) which
could be used to embed a specific range and/or styling of text in a post.
These advantages of widely-used query strings also go for people sharing
links or bookmarking for themselves.
"business logic". We are using Jamilih-based
templating to allow for templating functions in Vanilla JavaScript (as
well as avoiding ugly, angular HTML almost entirely!). While the results
display for users leverages CSS classes, we still need to remove some
inline styling for better structural (HTML) vs. styling (CSS) separation.
- We aim to leverage modern syntax, especially JavaScript, allowing
derivative projects to polyfill if they wish to support older browsers.
Besides aiming for better forward-compatibility, this allows us to use
standard, well-known patterns, as well as more readable, succinct code.
- We hope for good test-driven development, but currently this is limited to
schema validation. We are still in need of a choice of UI testing
framework and tests (as well as for unit tests).Installation
npm dependency.install`
npm install textbrowser --saveUsage
dependency of their own project.
following, see the
bahai-browser
project or for a project just implementing the JSON files, see
bahaiwritings.
section.
to represent your texts. See the section
JSON Formats.
To provide a common naming mechanism across projects and to avoid
the need to tweak the default TextBrowser JavaScript class set-up, a
specific directory structure
is recommended for hosting these files.
to make available and optionally the interface languages you wish to
make available (and for which you have locales), and after it may be
ready, and if you wish, the JSON files to indicate your site hierarchy.
See the
recommended directory structure
section for more. for an example) which includesTextBrowser
TextBrowser's own project scripts and your own script to instantiate
the class (and if you did not follow the
recommended directory structure,
you will need to point to the above-mentioned JSON
files). Page titles are set dynamically for each page, so there is no
need to provide a .TextBrowserRecommended Project Directory Structure
JavaScript API) is as follows:textbrowser as a dependency as perpackage.json
the Installation section above.
- node_modules - TextBrowser and its dependencies will be
added here via npm install as well as any dependencies you indicate
within .index-sample.html
- index.html - The main application code. One can use
as is or modified as desired. Note that itresources/user.css
may be sufficient to modify and resources/user.js.index.html
- resources/user.css - Add any custom CSS you wish to apply
for . (This convention allows you to get custom stylingindex.html
without modifying the sample index file.)
- resources/user.js - Add any JavaScript you wish to use. (This
convention allows you to get custom styling without modifying the
sample index file.) Unless already invoked in , you shouldTextBrowser
call the constructor here. See TextBrowser'sresources/user-sample.js
for a pattern you can copy and optionallyserviceWorkerPath
adapt.
- resources/user.json - Indicates meta-data for consumption by
service worker
- plugins/ - While not yet in use, this is the convention we wish
to begin enforcing for hosting plugins (e.g., for automated columns).
See Plugin Format.
- sw.js - Although you can change the name of this file via
(see JavaScript API), thissw-sample.js
file should be at or higher than the files you are caching (including
TextBrowser's). Copying as sw.js at your projectlocales/
root is the recommended approach.
- data/ - Directory recommended as a convention for holding JSON data
files. It is also recommended that child directories be named for each
file group, and within each file group, have the JSON data files
as well as "schema" and "metadata" subdirectories containing the
specific JSON schemas for each data file and the
TextBrowser-specific meta-data files. See JSON Formats.
- files.json - See JSON Formats.
- site.json - See JSON Formats.
- locales/ - Only needed if providing an alternate to TextBrowser's
own built-in . It is recommended to rely on the defaultlocales/
files and not add any custom files (contributing back here any
localization fixes or additions you may have done!). See
JSON Formats.
- languages.json - As with , only needed if providing anappdata/languages.json
alternate to TextBrowser's own built-in file.files.json
It is recommended to rely on the default and not add any custom file. See
JSON Formats.JSON Formats
defines the format and an example file. They then follow with a
plain language description of the format. and metadata files islocaleKey which is a non-standard means of pointing to a keyfiles.json
for substitution. It may be replaced in the future by the slightly
more cumbersome though standards-track
JSON References.$3
for more details.$3
following files to indicate behavior for the text-browsing application as a
whole.data/
See this file
for an example.
inclusion (e.g., any kept in ).schemaBaseDirectory andmetadataBaseDirectory at root apply to all groups.groups is a root array property whose items are file group objects whoseid
keys include the string, the name string, the directions stringschemaBaseDirectory
(for indicating instructions), as well as optional, group-scoped, and metadataBaseDirectory properties.files array property contains object items with the following properties:name
a string or localization key (or a file group display name),schemaFile and metadataFile string file paths (resolved relative to thefile
respective base path properties), and which is an reference to ashortcut
specific JSON data file
table-container.jsonschema).
There can also be a property which is used for indicating thelocalization-strings
keyword to use when the "Generate bookmarks" button in Preferences or
"Copy shortcut URL" is used to build URL keyword shortcuts (what Chrome
considers a custom search engine). key object, keyedfiles.json
to language code, which is keyed to an object of keys (which can be strings,
arrays of strings, or other objects of keys, including specifically for, the object property workNames whose keys are work names, andplugins whose keys are plugins and whose object values have a fieldnameplugins
key). object property indicates scripts in metadata.path, and the optional properties onByDefault boolean and lang languagemeta
code string. There may also be a key which is used to pass data to theplugin-field-mapping
plug-in. This object currently only allows string keys.
to by the path. object property has keys which act as groups andplacement
whose object key values include works as keys and whose key values include
field names as keys and whose key values includes field arguments, namely: (the string "end" or a number to indicate placement relativeapplicable-fields
to other properties; this might be changed to a string indicating field
name)
- an object property whose properties are field namestargetLanguage
pointing to an object key value with properties that may vary with plug-in,
but which specifically reserve a language code string{locale}
property (or array of strings or the special string to indicateonByDefault
the value will vary be determined by the current locale) and a
boolean property. There is also a meta property objectlanguages.json
whose key values must currently only be strings. and locales/en-US.json, etc.locales/
changes you may need of the generic localizations within andappdata/languages.json, if you need to provide your own interfacelanguages
localization, you may supply a property when creating theTextBrowser object to point to a languages JSON file of your ownlanguages.json
choosing (see the JavaScript API). file atappdata/languages.json which, as mentioned, is used by default. It adheres tolocaleFileBasePath
this schema and the property languages which is an arrayname
of objects containing the properties, , code, direction,locale
and (the latter leads to a locale file).localization-strings object, keyed tolocale
language code, which is keyed to an object of keys (which can be strings,
arrays of strings, or other objects of keys). property within languages.jsonlocales/
(by default, those at , e.g., locales/en-US.json), adhere tolocalization-strings
this schema.
This schema is also used for localization within metadata files. See textbrowser-data-schemas.
are themselves objects).
groups, and for your site navigation, on the other hand, are handled in
the other relevant sections of this document (see the files.json
property within metadata files, , and site.json, respectively).site.jsonsite array property indicating nesting of thenavigation
site's page hierarchy (intended to be used for site map generation). The file
also expects a property (with the same allowable values, or evensite
a JSON Reference
pointing to ) to indicate the subset of this site
available on the navigation bar (an array with strings or nested child
arrays of strings). Besides creating a navigation bar, it is
also intended to be used to generate breadcrumbs, links,localization-strings
and a sitemap. object, keyed tofiles.json
language code, which is keyed to an object of keys (which can be strings,
arrays of strings, or other objects of keys).Plugin Format
may have any of the followinggetCellData({tr, tableData, i, j, applicableField, fieldInfo, applicableFieldIdx, applicableFieldText, fieldLang, getLangDir, meta, metaApplicableField, $p, thisObj})
exports. See the subsection below for details on arguments shared by multiple
methods.tr[j]
- Used to build the plugin field's cell contents. The return value will
set unless the return is falsy in which case applicableFieldTextescapeColumn: false
will be used. Invoked for each cell of the data. To return HTML, must use
in conjunction with . Besides properties shared withgetCellData
other methods, is passed the following:tableData
- - The entire set of table data as an array of arrays (ofi
strings and/or integers), containing non-plugin content and any
already processed plugin contents.
- - The 0-based row integer.tr
- - Equivalent to tableData[i]fieldInfo
- - Array of info about all fields; has the followingfield
properties if not a plugin:
- - The schema title if not a pluginfieldAliasOrName
- - Obtained by finding alias if presentfield
or the otherwiseescapeColumn
- - true if schema format is not "html"fieldLang
- - The lang of the metadata object for fieldplugin
If it is a plugin, will have the following properties:
- - The files.json plugin objectmeta
- - The plugin metaplacement
- - As with plugin-field-mapping placement but"end"
with replaced with InfinityfieldAliasOrName
- - The result of getFieldAliasOrName onplugins
the plugin if present or the localization of the 'fieldname
escapeColumn
- - true if the plugin's escapeColumn is not falseonByDefault
- - The applicableField's onByDefault if a boolean,false
the current plugin's if truthy and otherwiseapplicableField
- - The applicable-fields fieldmetaApplicableField
- - The meta of the applicable-fields fieldfieldLang
- - The targetLanguageapplicableFieldIdx
- - The fieldInfo item whose field property is equal to applicableField.applicableFieldText
- - Equivalent to tr[applicableFieldIdx]fieldLang
- - The fieldLang property of fieldInfo[j]getLangDir
- - A method for determining directionalityfieldInfo[applicableFieldIdx].fieldLang
("rtl" or "ltr") for a given
language code. May be useful with
escapeColumn
- - Boolean (defaults to true). If set to false, will avoiddone({$p, applicableField, meta, j, thisObj})
escaping, though the plugin rendered cell data should be trusted to avoid
possible cross-site scripting.
- - Invoked after all cells ofgetTargetLanguage({applicableField, targetLanguage, pluginLang, applicableFieldLang})
the table have been processed.
- -lang
Called for each plug-in. The return value will be used for setting the
of the plug-in field. May return {locale} to indicate thetargetLanguage
language should follow the locale. The supplied is anytargetLanguage
property found on the plugin-field-mapping's'applicable-fields
field. pluginLang is the (default) lang forfiles.json
the plug-in (from ). applicableFieldLang is the defaultlang
lang when there is no target language or plugin lang; it is the getFieldAliasOrName({locales, workI18n, targetLanguage, applicableField, applicableFieldI18N, meta, metaApplicableField, targetLanguageI18N})
of the applicable field.
- -getTargetLanguage
Called for each plug-in (after ). Sets the fieldInfofieldAliasOrName
which is used for labeling the field. BesidesgetFieldAliasOrName
properties shared with other methods, is passedlocales
the following:
- - The app lang array (URL-specified lang languages ornavigator.languages
fallback-specified ones from that areworkI18n
supported by the app)
- - An intl-dom localefiles.json
formatter based on locale strings.applicableFieldI18N
- - The localized metadata fieldnames applicableFieldtargetLanguageI18N
- - The localized name of targetLanguagetargetLanguage
- - The result of getTargetLanguage (or thetargetLanguage
argument to it if not present)$p$3
- Usable for getting URL parametersapplicableField
- - The field indicated in files.json as beingmeta
applicable to the plugin.
- - See the property from fieldInfothisObj
- - The TextBrowser instancej
- (i is for column) - The 0-based column integer.metaApplicableField
- - See the property from fieldInforesources/user-sample.jsSecurity notes
at present by which a malicious data file could perform XSS attacks. Please
ensure the data files (and schemas/metadata files) you indicate are trusted.JavaScript API
application's behavior beyond that determined by your JSON and schema files. for an example (where the sample pathsnpm
are assumed to be relative to a package that contains TextBrowser
as a dependency).namespace
with the following optional properties: - Namespace to use as a prefix for all localStorage,indexedDB
caching, or usage. Defaults to "textbrowser" but thisfiles
could clash with other TextBrowser projects on the same origin,
so you should change for your project. (This setting might be used in
the future for any other namespacing.) - Path for the files.json containing meta-data on the files"files.json"
to be made available via the interface. Defaults to .languages - Path for the languages.json file containing meta-dataTextBrowser
on the languages to be displayed in the interface. Defaults to
the project's "appdata/languages.json".site - Path for the site.json containing meta-data on the site.site.json
Defaults to . (Only used currently for localization,userJSON
but may in the future provide surrounding navigation information
such as breadcrumbs.) - Points to the user JSON file, resources/user.jsonstylesheets
by default. See the "User JSON" subsection below. - Array of stylesheet paths and/or of two-item arrays@builtin
with stylesheet path and
loadStylesheets
options. A string path may also be which attempts to loadserviceWorkerPath
the default stylesheet without need for path (but due to current
browser limitations with a lack of import meta-data, we cannot
provide this accurately for all configurations at the moment). - Service worker path which defaults to"sw.js"
(which, if you are including TextBrowser via npm,dynamicBasePath
will be within your own project root). This should probably not
be adjusted (and if you do want to adjust it, it may be better
to file an issue or PR to allow us to provide choices among
various default-available service worker/caching patterns). - Base bath for the server hosting the TextBrowserlocalizeParamNames
content. Defaults to the current site. - Boolean as to whether to localize parameterallowPlugins
names by default (can be overridden by the user in preferences).
(This has not been fully tested.) - Enables files.json-specified plugins to be run.false
Defaults to as it causes scripts to be run, but if you trustfiles.json
your JSON source files, you will presumably wish to enable this
to get the full functionality designated within the JSON (and add
the script files designated in to your project).trustFormatHTML - If true, inserts fields designated by your"format": "html"
JSON schema as as HTML without escaping; thisfiles.json
option is off by default in case the source is untrusted,
but if your -indicated files are trusted, you willtrue
probably want to this set to .requestPersistentStorage - Defaults to true. Set this tofalse
if you don't want to even ask for permission to storenoDynamic
the data files persistently. Note that this can really degrade
performance, especially with large data files, as the whole data
file must otherwise be downloaded for each result display. - If there is no server-side component to expediteskipIndexedDB
non-indexedDB queries - If one wishes to force avoiding indexedDB evenhideFormattingSection
when permitted by user (for testing) - Boolean as to whether to hide the formattingfiles.json
section by default (can be overridden by the user in preferences).
This section might be changed to a plugin in the future in which case
you'd just avoid designating it within .preferencesPlugin - A function to be passed the following arguments$
and to return a Jamilih array: , l, jml, paramsSetter,getDataForSerializingParamsAsURL
, work, replaceHash,getFieldAliasOrNames
interlinearSeparator - HTML code to be injected between each
interlinear entry; this is not exposed to the user for
security reasons (preventing cross-site scripting
attacks); defaults to though one may set to
another string such as . If you need greater control,Templates.resultsDisplayServerOrClient.interlinearTitle
you might consider monkey-patching the simple templating function
(andinterlinearSeparator
optionally setting to an empty string ifshowEmptyInterlinear
you use that function to handle the separation), but please note
that this API could change. We may add some predefined choices for
users in the future. - Whether to show empty interlinear entriesshowTitleOnSingleInterlinear
(with a title). We may put this under user control in the future. - If only the main item is present innpm
an interlinear-enabled column, this determines whether a title (if
enabled) will be shown. We may put this under user control in the
future.,resources/user-sample.json
our API should continue to work until an increment in the major release
number.
upon for monkey-patching.$3
).namespace
The properties are: - See above.files
- - See above.languages
- - See above.basePath
- - Base path to files.json fetches.userStaticFiles
- - Array of files additional to those of['/', 'index.html', 'files.json', 'site.json', 'resources/user.js']
TextBrowser which you will need offline. Defaults to the minimum
recommended files:
textbrowserServer API
server API offers the same arguments as the TextBrowsersite
constructor (minus , stylesheets, requestPersistentStorage, noDynamic,skipIndexedDB, and hideFormattingSection). In addition,domain
it supports the following arguments: - The domain for hosting the server. Defaults to localhost.port
- - The port on which the server will be hosted. Defaults to 8000.nodeActivate
- - This argument must be run once to build the necessaryimf
database files. While the database files will be SQLite based, they
are consumed by IndexedDBShim.To-dos (Highest priority)
1. Fix regression upon converting from to intl-dom that locales/textbrowser?lang=...
do not properly default (to English) when missing and give errors
1. Figure out why isn't working now ondefault_view
1. Adapt approach of
choice of items to offline (also add to individual work pages).
1. Mention idea that it works offline
1. Default field(s) and default value(s) for when no text is entered and
a reasonable sample is desired to be shown. Use already&checked1=Yes
spec'd in metadata schema and used in files.
1. Also have omitted when generating results displaypnpm
(since now defaulting to this)
1. Drop unused fields in URL by default
1. Ensure works with in all environments (didn't work when deployed,navigator.storage.estimate
but would need to recall the problem and resolve)
1. Intl.DisplayNames
1. Consider using (type: 'language') with plugins solanguages.json
can, e.g., show language visibly into which a targeted content language
field was translated? Avoid need for codes and directions?stylesheets
1. For plugins, allow export of array to add toloadStylesheets
, so they don't have to do the importing and executing.CHANGES.md
1. Progress meter with hidden console to avoid intimidating loading
messages of service worker; also retrieve latest in !files
1. Move "Go" to right (or immediate bottom) of paragraph selections
1. Overflow on cells past a certain height—especially for indexes
1. In place of passing in , namespace and languages, passuserJSON
in
1. If get MapText working, could
actually extract out image portion(s) into table cell to show the
original Tablet portion alongside commentary, etc. (along with
MapText tooltips and text copy ability to get at the real text
from the images; ideally any global search would be able to reach
into these as well, though that will probably just duplicate what
is already in the corresponding JSON store as a regular text column).
1. Text box parsing
1. Document availability of this parsing
1. Fix limitation that 0's don't change to 1's if
not present as a minimum (e.g., if no 0 for Chapter
number, then won't show anything).
1. Avoid need for separate for browse set;1:2:3-1:2:5#1:2:4
e.g., parse Rodwell or Sale?
1. Ideally work across even book
1. Support anchor portion (e.g., )activateCallback.js
1. Move plug-in set-up to run so setting indexedDB within
indexedDB
1. Have IndexedDB handle all pages language select, work select, and
work display be part of too?
1. for JSON dataindex.js
1. Node.js (or PHP?)
1. Delivery of HTML content by same URL so third parties can
consume without JavaScript and optimized when not offline
1. Progressive enhancement is faster
1. Optimize Jamilih to build strings (for performance and also for
server) and utilize here; also to preprocess files like our
templates to convert Jamilih to complete string concatenation
as is somewhat faster
1. Serve JSON files immediately and then
inject config for to avoid reloading?sites.json
1. Use IndexedDBShim
(with service worker shim?) to optimize on server
1. Icon for click/hover to get interlinear field explanation
1. Fix for local notes storage plugin when in interlinear column
1. Fix for interlinear not showing when opting for non-default
"Field Title" in pull-down.
1. Fix for "Save settings as URL" not properly serializing plug-in
columns
1. Allow localization of URL parameters to optionally work with any
language (or at least the locale and default/English)
1. Fix sometime obscuring of headings
1. Document
1. Need of setting certain locale strings, including .resultsDisplayServerOrClient.js
1. Use schema-detection of type for sorting--integer
parsing only on URL params per schema); see
with to-do by parseInt (andString()
also see conversions)localizeParamNames
1. Get file names to be namespaced to group name to avoid name clashes
1. Locales
1. Check (preference)?Max: 100
1. Test all locales and works and combos
1. Allow all text to be shown (whether anchored or not)
1. Indicate min/max as placeholder text (?)
1. Rename "Field" to "Column anchor"
1. Renaming/linking to fuller descriptions or graphics explaining
options/preferences regarding locale, interlinear, CSS
1. Plugins/Automated fields
1. Extensibility (note: Some below may already be implemented)
1. Implement (worker-sandboxed (and parallel async-loading per
row/cell?)!)
1. Admin/files-driven and ideally user-driven (though security issue
for additive approach); could let plugin itself accept user input
1. Additive or reductive (omitting/merging)
1. Columns or rows
1. Admin-controlled merging/omission of columns like
interlinear
1. Merging rows with same number
1. Metadata for default field column placement and table/field
applicability
1. Browse fields or field list
1. Modifying existing content or not
1. Splitting columns (e.g., by line break)
1. Splitting rows by element (e.g., )rowspan
1. With optional /colspan for non-split portionsPromise.all
of row/column
1. Overlays
1. Levels of applicability
1. Automated whole document/table-level or column-level
changes (e.g., word counts) or even row-level/cell-level
(including language code)
1. Spans across section
1. Provide example plugins of each type for this version if possible
1. Define all possible areas as plugins? e.g., Move
search/CSS/interlinear, advanced formatting, or even browse fields
and/or field lists and/or search as a whole to plugins?
If doing so for individual fields in field lists, should support
adding, e.g., pull-downs, even multiple ones for arguments
(e.g., a web search plugin could specify the desired search engine)
1. Asycnchronous means of retrieving (and then caching, optionally on
an interval) automated data; use of single Promise to each plug-in
for whole table (or if necessary on each row)?files.json
1. Caching for automated field content like translations (with ability
to rebuild)
1. Collapsible columns with click status remembered from last time as
to whether collapsed or not
1. Specific automated fields
1. Previously implemented:
1. Option to show renamed fields (like "Book #" -> "Book Name"
for Bible) before renaming (reimplement as additive plug-in
but with one field on by default and the other off); already
has placeholder in - add to field-alias.js;format
already added to new version but need to reimplement as plugin
1. Synopsis, Roman numerals, Chinese numbers, word-by-word
translation, auto-romanized Persian/Arabic, Persian with
English tooltips, English with Persian/Arabic tooltips, ISBN
for Collins (use JSON Schema for link detection--might
also reimplement ISBN to make use of JSON Schema format);
text-to-(Google search, Google define, Wikipedia, etc.
edit pages)-links
1. Auto-links by verse to relevant forums, wikis, blogs, or personal
notes pertaining to a given verse; also Q&A and (federated)
social media
1. Offers advantage of not needing to reinvent login control
1. Built-in (including offline or only offline) note-taking
(local/remote and wiki WYSIWYG with Git version control?);
modular loading of others' notes?
1. Back-links for index entries (which needs its own JSON Schema-based
project for the hierarchical representations (see
TEI
for ideas)) including optionally merging them for different books
1. Support metadata to omit or combine fields during browsing (like
checkboxes and interlinear field, but admin-set; also ensure, or
add option for, no line breaks or indication of original source
column within interlinear display so not bloating or surfacing
internal column differences to users); increment counts despite
some surfacing, as better ensures future compatibility/portability
1. Automated field to split up rows based on presence of or
, etc., with the ability to browse by such numbers (wouldrowspan
ideally tap into browsing autocomplete code indicating min/max
too). Optionally get s (or even colspans) for additionalMatt. 5:10-12
columns (e.g., a field spanning by whole pages of a book and
another field spanning only by paragraphs) - use some kind of
counter and don't display the HTML until finished cycling??; also
figure out how to reassemble if the minute fields are not needed
(e.g., if the user only wants to see the text by paragraph and
not anything related to by page); will provide a new browsing
column and also divide certain existing one(s)
1. Allow automated algorithm to merge, remove rows (e.g., intro
section of text with same "0" number)
1. Splitting columns by line break, etc.
1. Means on results display page to highlight (including
discontiguous) selections and convert this into a new selection
and/or syntax (generic to TextBrowser and/or canonical, ideally
human-readable based on JSON-supplied information; e.g., for the
Bible, ); use with postMessage to-do to supplylocaleKey
syntax back to another site; see
Scroll To Text fragment;
Stack answer
1. Correct any field easily by links within TB to editing interface
1. Add an "overlay" column like interlinear, but which overlays by
tooltip if any data is present; can also use metadata if the
overlay is within-cell (and this metadata can also be used for
putting overlay data in its own column too, albeit with only
partial mapping to the other columns, e.g., if our "Baha'i
translation" had not already been put into its own column, a
metadata mapping may only have been for two discontiguous
sentences out of a paragraph, but could still show such sentences
reassembled (with some kind of separator) in a paragraph-based
cell)
1. Deal with other metadata/automated (besides overlays) which is
intended to allow collapsing of ranges (above paragraph cells,
but may overlap); do as multiple tbodies but needs to be done
dynamically since may wish alternate (and nestable) collapsing
(e.g., collection->book->chapter, user-contributed metadata
sections, etc.); allow collapsing/expanding of all fields by
one click button outside table (or by level); allow automated
collapsing based on sequentially exact values (e.g., until
rows stop having a column with value "1")
1. Allow collapsing even within cells (as with overlays) (like
our "Baha'i Translation" could have been). Also make
non-metadata regions collapsible so can hide them from view.
1. Allow something to be prefixed to interlinear number to
indicate the field should be treated as an overlay (tooltip);
if so, may need tooltip to be in blocks in case multiple
columns added. But also need to have section for automated
fields separate from the regular fields for those fields
which do not map exclusively by cell boundaries (or
relatively within them).
1. Allow types of overlays (or "mashes") such as underlays (adding
invisible metadata), onlays/"mash ons" (replacing text in
place), as well as regular overlays (adding text via
mouseover); let these be alterable as possible by the user
(e.g., text might be desirable to replace existing text or
put it as a mouseover)
1. Allow for dynamic addition of JSON overlay sources or metadata
to work selection/work display files?
1. See bahai-browser project re: using Firefox's
Browser API
to allow independent navigation controls for each iframe (and
side-by-side viewing of verses/lines and commentary)To-dos (High Priority)
or JSON Schema Annotation and Documentation Extension):
i18n: Utilize more standard mechanism instead of our ;$
might also use substitutable JSON References (see
and
0. Remove need for separate metadata files per
by using initial ?!important
1. Find way to avoid need for in column CSSdeserialize
1. Redirect automatically by accepted language, though have a link or
preference to change the default
1. Offer more border styling tuning controls (including right/left/top/bottom,
color, etc.); then offer this along with other styles if we replace CSS
input box with pop-up styling form (like Advanced Formatting, but for columns)
1. Refactoring: Try to use of form-serialization fork forFormData
initial population or hash change? (if not )onByDefault
1. We should try to allow and placement for non-pluginbrowser
fields also
1. ES6 Modules in browser:
Complete switch to imports over script tags (by updating dependencies to
use ES6 modules too and then use them; json-refs is only left); can also
avoid function-passing main functions as arguments
1. For json-refs, build on
ES dist. (Rollup or webpack CLI?) and /module
1. Apply
labels to provide machine-automated detection of licenses. (Adapt
LibreJS to work with
WebExtensions, to support in addition to visible links, and,showEmptyInterlinear
if it is not already, make blocking of sites without open source code
optional but notify one by icon so that one might know that a page is
using (or not using) open source.)
1. Add prior transpose functionality (affects header, footer, and body)
1. Expose interlinear andshowTitleOnSingleInterlinear
to the user interfacedata-footnote
1. Uncomment and complete random code
1. random within specific part of browse field range (e.g., within a
specific book)?
1. Have special meta-data for per book/chapter maximums (Bible/Qur'an)
to allow accurate and also for random verses?
1. with context
1. Leverage this code for random to implement random feature across
works within group or across all groups
1. As with table/array-of-arrays schema, develop schema for
outlines (and utilize, e.g., with JSONEditor)!
1. Develop footnote targeting mechanism to hide/reveal footnotes inline
(based on a attribute or the like). Utilize JSONlinks
Schema for indicating footnote location in document then
allow HTML to point to the scheme designated therein.querySelector
1. Search/Sorting
1. Add to preferences system for saved/favorite, recent
searches/browses, etc.
1. Specific filtering by textbox next to checked field selection
(commented out in workDisplay as not working yet in resultsDisplay)
1. Schema-aware and metadata-aware column sorting options (e.g., sort by
order and ASC/DESC) with user customizability (i.e., presorting along
with dynamic client-side after-load sorting, with or without search
filtering; use "search" in locale to add this filtering to UI)
1. Option for highlighting search terms (with own styles), and/or if
context is specified, to highlight rows with search results and
alternatively style context rows (distinguish from random context?)
1. Optional links to go to previous/next results if only loading a subset
of available content (allow customization of size of chunking in
preferences as well as on the fly)
1. Support user-driven or automated (expandable) ellipses for surrounding
content with option for highlighting these (e.g., to highlight a
parts of a sentence, including one spanning multiple rows/verses);
consider range for highlighting if verse range + added context range
not enough; "emphasis added", "passim", customization of citations
(moving caption to bottom)
1. Ability to run XPath/-like queries againstformat: "html"
fields relative to specific cells (or against&anchor=.myClass
original source HTML or XML document); also highlighting as
part of page anchor ala original XPath schemes (e.g.,
with text() from HTTPQueryform-serialization
to identify by text content too if not a full blown
query/transformation language)?To-dos (Medium Priority)
than locales.
1. Remove need for separate metadata
files per
1. Remove in favor ofprimary_text_field
FormData?
1. Replace comma-separated interlinear approach with a popup dialog
with multiselect
1. Preview styling changes (or move all controls to results page for
immediate real feedback)
1. Separate formatting within Jamilih code to CSS; unit test and
performance by being able to use a natively stringifying version of Jamilih
(once complete)
1. Utilize meta-data properties, , orig_lang_field,orig_langs
, e.g., to allow for user to display main language andhasFieldvalue
originals but not others? Use and roman (forouterHTML
non-automated Roman fields--could designate as Latin language, but
need a way to know are numerals for sorting if Arabic numerals not
provided)?
1. URL (sorted) params keyed to of page for cachingsites.json
1. Incorporate speech synthesis from
speech voices for different rows or columns (or just let user
add CSS to columns to mark). Could optionally display speech
controls on results display page
1. Callback options to replace or receive the results from each screen for
further manipulation (e.g., to add navigation, pending or different from
the intended behavior).site.json
1. Allow tables to be re-sortable via JavaScript which allows
sorting by multiple columns with various data, etc.
1. Build library (for browser or Node) to utilize file to add
site-wide navigation bar headers, breadcrumbs,
, sitemap, and page title (suppliedoutputmode
argument of the current page)? Also about text and removecookies/
choose a different language, and ability to optionally turn off in
results display (e.g., so a table's results can be embedded off-site).
1. Support JSON types for , openinglanguages.json
new window with content-type set
1. Node.js (and/or PHP)
1. Optionally allow server push and/or WebSockets updates of
content and software
1. Allow centralized copies or distributed versioning,
including single copy storage
1. Make tools to build based on availablefiles.json
locale files, and build based on a target directory.filetypes.json
1. HTTPQuery headers
1. (from WebAppFind) for app and schema association?web+bahaiwritings:
(files.json for permitted files - a file which could be auto-created,
e.g., if server permits all in a directory); especially potentially
useful with JSONEditor to allow editing of these files, app types
(replacing assistant.php):
1. langs + locale / locale only
1. files/dbs->file (supply language choice)->file contents
1. schemas
1. Code to populate locale files with missing localization strings and
report the missing ones (and sort as such in assistant file); put
assistant localization keys in own file?
1. Find translators to do further localization of the interface
1. Assistant file (for translating; needs server for password);
work optionally with main locales, files, table, and field
locale info. Use already-existing localization strings.
1. Add tooltips and table summaries, etc. back (see locale file for
these and reapply any other unused) and add any missing ones
describing how to use the elements
1. Give option to user (as opposed to admin) for preset interlinear choices
(e.g., separate by line breaks or page breaks)To-dos (Lower priority)
not as need RTL detection for more than setting on element)
1. Remember columns enabled, etc. since last visit, and/or saved as
preferences.
1. Allow copy-pasting a search as a custom web protocol (make
site-configurable), e.g., to support links per$locale
bahai-writings-handler
(demo);
could even use last visit or preferences status to tweak the resulting
appearance, column selection, etc.
1. In schema, let or * indicate all fields to be translatedfiles.json
where possible?
1. Preferences
1. Change Preferences to be set before work or with work but specific
to it
1. Change Preferences to disallow URL overriding
1. Change preferred languages preference to be dynamic with work
column languages
1. Preference to remember enabled checkboxes and formatting
1. Change to utilize history.pushState?
1. Sort file selection listing per locale?
1. Node.js synchronization of locale files?
1. Could allow Node to built schemas, optionally allowing or disallowing
unresolved JSON References.
1. Might support arbitrary JSON and JSON Reference querying
(if configured to indicate a wildcard or something)langs.json
1. Update "about" text and utilize on popup or something?
1. Change "Saving settings as URL" to a redirect if faithfully
copying everything?
1. Provide option to skip over with a default languagelang=
(though discourage since the UI translations may help some people).
1. Allow user to pass array of language codes that can be checked
at the beginning of the string without need for (or forwindow.postMessage
the i18n of "lang"?).
1. API (since CORS is only for Ajax anddocument.domain
is only for subdomains).tabindex
1. Restore usage`
1. Restore option from work page to have a checkbox on whether to go to
"Advanced mode", opening the styling options by default or not.Testing
rebase the code, making it harder for one to keep up to date in this manner.
2. Install the package's dependencies via:shell`
npm install`
3. Test via:shell`
npm testfiles.json
application. The bahai-browser
project hosts validation of specific files expected by TextBrowser, such as and specific schemas and meta-data files needed for that project.`shell`
npm start`
run, use:shell``
npm run start-no-open
(from Contributing
testing coverage (PR's welcome for this too!).
enhancements to the core ought to be confined to the
main project goals and be oriented toward reuse across all
projects, relegating any specialized tools to plugins (though
we can set up the wiki to point to your plugins once a plugin
system may be in place).History
first project used in aiding my learning programming.
as 17 May 2006:
-
-
applied to the server broke the old code and for which I did not find time
to work around.About
BADI
mailing list created to foster collaboration among open source projects
and initiatives such as this which are Baha'i-inspired but will or may be
of interest to the wider software community as well.