freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Important changes in Docwriter


From: Nikhil Ramakrishnan
Subject: Re: Important changes in Docwriter
Date: Mon, 4 May 2020 23:55:57 +0530

> This is unfortunate.  Is there something less invasive available?

I did a quick search, and came across this pull request in the mkdocs
repository:

  https://github.com/mkdocs/mkdocs/pull/1805

I quickly tested this:

* Create the file `docs/markdown/javascript/fetch_shim.js`, adding the
contents of the attached file.

* Run this command in `docs/` directory:

  `echo "shim_localSearchIndex = $(cat
reference/search/search_index.json)" >
reference/search/search_index.js`

* Add the two lines below to the `extra_javascript` field in `docs/mkdocs.yml`:

  - search/search_index.js
  - javascripts/fetch_shim.js

* Run `mkdocs build` in the `docs/` directory.

Search works locally after following these steps.

Unfortunately, this breaks the site (freezes completely because the
script fetch_shim.js goes into some kind of infinite loop) when I try
to serve it locally with `mkdocs serve`.

To implement these changes to allow them to work with docwriter will
require fixing the attached script to prevent the page from freezing,
modifying docwriter to add the required entries to `mkdocs.yml`, and
possibly the build system to create the `search_index.js` file after
the site is generated.

Another option seems to be using the `mkdocs-localsearch` plugin
(https://github.com/wilhelmer/mkdocs-localsearch#installation-material-v4),
but I am getting errors while trying to build the site (with `mkdocs
build`) after following the instructions given in the link.

Unfortunately, it is unlikely that I will be able to find time this
week to work on this, although I can help with finding the files/build
targets to make the required changes once the problems I stated above
are fixed.

Nikhil

Attachment: fetch_shim.js.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]