Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 2.65 KB

File metadata and controls

26 lines (16 loc) · 2.65 KB

Wikipedia iOS Web Development

The app uses several web components. This document explains how they are set up and how to update them.

Article View

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

Editing View

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.

Changing resources files

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:

  1. The wikipedia-ios repository has a submodule that points to the wikipedia-ios-codemirror repository. cd to Wikipedia/CodeMirror/wikipedia-ios-codemirror, then pull the latest changes from master. If the Wikipedia/CodeMirror/wikipedia-ios-codemirror directory is empty, you can first run the scripts/update_submodules script to initalize the submodule.
  2. From the scripts folder, run the copy_code_mirror_resources script. This will copy the relevant resources folder from the submodule into the iOS project assets folder.
  3. Commit your changes and open a PR.
Generating config files

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.

Other Views

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.