Text edit area should be monospace

Issue #572 resolved
Douglas Thor
created an issue

The main text edit area should probably be monospaced.

This is especially useful for the ReST syntax, as many things (headings and tables, specifically) rely on having the same number of characters. With variable-width fonts, it's hard to tell when the heading over/under bar has the same number of characters.

Comments (8)

  1. Douglas Thor reporter

    There are two options for this:

    1. Edit #moin-modify textarea to be monospaced, running through a variety of fonts before falling back on the system default monospace. branch

    2. Add the .moin-fixed-width CSS class to MoinMoin/templates/modify_text.html branch

      • Does MoinMoin/themes/basic/templates/modify_text.html also need to be modified? It didn't actually do anything when I made the change.

    Please let me know which you'd rather have and I'll open the PR.

  2. Roger Haase

    That "Toggle font width" button at the top of the textarea doesn't work for you or is just annoying?

    I usually edit moinwiki pages and find the proportional font easier on my old eyes.

    The best way to fix the issue is to add a textarea monowidth/proportional font choice to UserSetting > Appearance so every user can choose their starting font style. The downside is that alternative is no longer a trivial fix, but rather medium.

    A workaround to use until the above gets implemented is to use the local customization features - copy /MoinMoin/templates/snippets.html to /wiki_local/snippets.html, then edit the "Additional Javascript" section like so:

    {# Additional Javascript #}
    {% macro scripts() -%}
        {# <script type="text/javascript" src="{{ url_for('serve.files', name='wiki_local', filename='MyScript.js') }}"></script> #}
        <script type="text/javascript">moinFontChange()</script>
    {%- endmacro %}
    
  3. Douglas Thor reporter

    ... I did not see the "Toggle Font Width" button. My bad! If that gets saved on a per-user basis then that's amazing. If not, it's still not a big deal to click it when needed - and as you said, some people like the proportional-width stuff, so I don't want to force it on people.

    Thanks for the info about the javascript snippet, I'll look into that too.

  4. Roger Haase
    • changed status to open

    Reopening the issue as there is an almost trivial way to implement the feature.

    Enhance the JS supporting the "Toggle font width" button to save the state of the font width in the browser's local storage every time the button is clicked.

    Add a new bit of JS that runs on document ready to check the last saved state in local storage (if any) and toggle, if needed, the "moin-fixed-width" class on the textarea.

  5. Log in to comment