Fortran-FOSS-Programmers / ford

Automatically generates FORtran Documentation from comments within the code.
https://forddocs.readthedocs.io
GNU General Public License v3.0
405 stars 131 forks source link

Refactor static pages code; Ensure static pages are read with project `encoding` #521

Closed ZedThree closed 1 year ago

ZedThree commented 1 year ago

Fixes #518

@zoziha If you're able, please could you try this branch and check that it fixes your issue?

zoziha commented 1 year ago

This PR fixes that issue, thank you for this fix, @ZedThree .

I tested this PR locally, and everything worked fine because of the encoding configuration applied to static pages. I tested the following:

  1. Default: encoding:utf-8 is not declared in the FORD.md project file. ✔

    UTF-8 encoded Fortran source code and static pages success expectedly. GBK encoded Fortran source code and static pages fail expectedly.

  2. Declare encoding:utf-8 in the FORD.md project file. ✔

    UTF-8 encoded Fortran source code and static pages success expectedly. GBK encoded Fortran source code and static pages fail expectedly.

  3. Declare encoding:gbk in the FORD.md project file. ✔

    UTF-8 encoded Fortran source code and static pages fail expectedly. GBK encoded Fortran source code and static pages success expectedly.

The above results are as expected.

PS. The FORD.md project file with non-ASCII code should to be UTF-8 encoded, otherwise the build fails.

ZedThree commented 1 year ago

Great, thank you @zoziha!

I would like to be able to relax your last point about the project file needing to be in UTF-8, but I'll try to address that in the future