Giter Club home page Giter Club logo

Comments (4)

colintedford avatar colintedford commented on August 26, 2024

Same problem. I don't see a setting, so I assume it's a bug.

from better-word-count.

lukeleppan avatar lukeleppan commented on August 26, 2024

Hi thanks for raising the issue. Mobile versions don't have a status bar. So displaying the word count in that way is not possible. However, the statistic collection function is still functional and will detect writing stats over all your devices. In the future you will be able to view your statistics on mobile too.

from better-word-count.

colintedford avatar colintedford commented on August 26, 2024

Until this feature is officially supported, here is a workaround for iOS/iPadOS 15 (should also work on MacOS Monterey but I haven't tested that yet).

This is my setup, which assumes you want to exclude comments from the count, but only excludes HTML-style comments (which I use for wider compatibility, along with text replacement to make typing them easier). Adjust as needed.

In the Shortcut Launcher community plugin, create a new launcher:
- Command Name: Word count minus comments

  • Shortcut name: Obsidian Word Count Minus Comments
  • Input Type: Multiple
    • Input Type #1: Selected Text
    • Input Type #2: Entire Document
    • Separator: %%OSL%%

Install my Obsidian Word Count Minus Comments shortcut or make a similar one. Obsidian Word Count Minus Comments does the following:

Split Shortcut Input by Custom %%OSL%%
// The “_” here stands for a blank field in Shortcuts.
Replace (?=<!--)([\s\S]*?)--> with _ in Split Text
Get First Item from Updated Text
Set variable SelectionText to Item from List
Get Last Item from Updated Text
Set variable DocumentText to Item from List
Count Words in SelectionText
Set variable SelectionCount to Count
Count Words in DocumentText
Set variable DocumentCount to Count
// The space between “SelectionCount” and “Document” here stands for a newline in Shortcuts.
Show Selection: SelectionCount Document: DocumentCount

The comment exclusion in my shortcut isn't perfect. If you have malformed comments like

<!--Comment 1, which I forgot to close
<!--
Comment 2
-->

it will count all of those words.

On mobile you can’t pull down to summon the command palette when text is selected, but you can add the command palette button or your new “Word count minus comments” command to the mobile toolbar.

from better-word-count.

lukeleppan avatar lukeleppan commented on August 26, 2024

Since there is no mobile status bar mobile support will come in the form of a separate view, in note statistic rendering and maybe some commands like the work around you have shown. Closing this for now.

from better-word-count.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.