The app uses several web components. This document explains how they are set up and how to update them.
The article view uses a server-side response from our Page Content Service with additional local js
and css
files for further customizations. These local files live within the Wikipedia/assets
folder in the project. You can update these directly and commit the changes, with the exception of the codemirror/resources
, codemirror/config
and pcs-html-converter
subdirectories (explained next).
The editing view is also a web view, but all files powering it live locally in the project. The files within Wikipedia/assets/codemirror/resources
and Wikipedia/assets/codemirror/config
are copied from our separate submodule repository or autogenerated respectively, so they should not be edited directly. Details are below for updating these areas.
First open a PR in the wikipedia-ios-codemirror repository repository. Once that is merged, to reflect those changes in this project follow these steps:
- The
wikipedia-ios
repository has a submodule that points to thewikipedia-ios-codemirror
repository.cd
toWikipedia/CodeMirror/wikipedia-ios-codemirror
, then pull the latest changes from master. If theWikipedia/CodeMirror/wikipedia-ios-codemirror
directory is empty, you can first run thescripts/update_submodules
script to initalize the submodule. - From the
scripts
folder, run thecopy_code_mirror_resources
script. This will copy the relevant resources folder from the submodule into the iOS project assets folder. - Commit your changes and open a PR.
We instantiate our CodeMirror editor with configurations that are generated into the assets/codemirror/config
folder. These files should not be edited directly. You can edit the output of these files inside Command Line Tools/Update Languages/WikipediaLanguageCommandLineUtility.swift
if needed, then run the Update Languages
scheme to regenerate these files.
There are other CodeMirror files that do not originate from the wikipedia-ios-codemirror
repository or the languages command line utility (anything in assets/codemirror
, excluding /resources
and /config
). These are styles and new functionality specific to the iOS app. These files can be updated directly.
There are other smaller web components in the app, such as the About view. These live in the Wikipedia/assets
folder and can be updated directly.