npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

mulmd

v0.7.0

Published

Editor and CLI(called mulmd) for maintaining a set of multilingual markdown(.md) files

Downloads

1

Readme

multilingual-markdown (mulmd)

Editor and CLI(called mulmd) for maintaining a set of multilingual markdown(.md) files

currently testing editor prototype

Started as an idea from a discussion .

TODO for intital release

general

  • [x] define inital format
  • [x] LIB: hashing rules
  • [x] LIB: uuid lib / func
  • [x] LIB: choose hash - MD5(cross platform and cross language) not for security, it is just helping detect changes in text
  • [x] create node project (package.json)
  • [x] CLI: create script with UUID and md5 included cli tutorial used
  • [x] LIB: setup first test (test sample text and md5 of it)
  • [x] LIB: sections parse - read md into obj model
  • [x] LIB: sections stringify - write md from obj model
  • [x] Editor: basic edit base file (drag and drop 1 file) sections outline, click to edit title and text separately one section at the time
  • [x] LIB: initialize sections (add uuids and hashes)
  • [x] Editor: publish as github page (docs folder) test version
  • [x] CLI: initialize base file (add uuids and hashes) mulmd init docs/editor/parameters.md
  • [x] Editor: initialize base file (add uuids and hashes)
  • [x] CLI: generate file for translation from base file mulmd init file.md file.fr.md
  • [x] Editor: generate file for translation from base file
  • [x] LIB: clean metadata, and copy sections (after that serialize produces normal MD file for publishing)
  • [x] LIB: optional section info for code blocks
  • [x] DOC: define/document options that can be used in CLI via package.json or as argument
  • [x] ALL: convert to ESM
  • [x] CLI: read package.json for options (like the one above)
  • [ ] Editor: ask option: section info for code blocks
  • [ ] CLI: export clean file (MD without medatada)
  • [ ] CLI: export clean folder (MD without medatada)
  • [ ] Editor: export clean file (MD without medatada)
  • [ ] LIB: translation info (details)
    • [ ] Case 1 - missing-translation
    • [ ] Case 2 - missing-original
    • [ ] Case 3 - initialized
    • [ ] Case 4 - initialized-dirty
    • [ ] Case 5 - partial
    • [ ] Case 6 - partial-dirty
    • [ ] Case 7 - translated-dirty
    • [ ] Case 8 - translated
  • [ ] Editor: basic edit translation file (drag and drop 2 files, together or 1 by 1)
  • [ ] Editor: edit translation file: with diff of changes in base file (drag and drop 2 files, together or 1 by 1)
  • [ ] CLI: sync translation by injecting missing sections
  • [ ] Editor: sync translation by injecting missing sections
  • [ ] CLI-pre-commit-hook: script spacification so it can be used to block unfinished edits
  • [ ] CLI: allow automatic pushing code-block changes across translations (if it was unchanged in the translation)
  • [ ] Editor: allow automatic pushing code-block changes across translations (if it was unchanged in the translation)
  • [ ] Editor: electron app
  • [ ] CLI-info: specification of the script (options and actions and infos that it can give)
  • [ ] CLI-info: xxx
  • [ ] CLI-info: yyy

package.json

maybe future

  • [ ] CLI: lint code sections (or standardx) ... have them included and linted separetely
  • [ ] Editor: lint code sections
  • [ ] use git to compare current file edited with latest git show HEAD:./filename.txt

format

General format is defined by JSON string injected at the end of each heading, additional brackets are added for less chance of conflict with heading title

  • id - id of the section
  • h - md5 checksum of the text
  • ts - timestamp when hash was generated and the hashed text id bound to the hash
  • trans - for translated section is percentage of translation done
    • -1 - for original file
    • -2 - for copy (the copied section in) this type of section is not to be exported as it is part of the file only for keeping track of the changes.
    • 0-99 - for translation
  • status - empty/ommited when everything is ok, any other value means something more needs to be done (checkGrammar,approve,in progress). This is not part of this tool, but is a proposal for further more complex management of the sections

Other utilities may inject more properties in the JSON, so editor should not clear them.

Base file contains the original text

# Main tile
({"id":"UUID", "h":"md5"})
some text.

## subtitle
({"id":"UUID", "h":"md5"})
subtitle text etc

translations inside code

There is already similar use case for footnotes in general

  • use footnote syntax inside code blocks by placing a footnote reference [^1],[^2],...
  • code block is then same for all languages and can safely be updated in an automated task across translations
  • translation is placed as footnote
  • this is mainly meant for comments, but may be even ok to use inside strings
  • when exporting md files one can move translations back to code block and remove from text body
  • if there is legitimate code inside code-block that would be mistaken for footnote syntax, one could then enforce a prefix for these translation footnotes that would then prevent the conflict with the code

example code block and translation as footnote later

|```js
({"id":"UUID", "h":"md5"})
|  function code(){// [^1]
|```
|
|[^1]: Comment for the function that can be translated without changing the code

UUID and hash is also generated for code sections

|```js
({"id":"UUID", "h":"md5"})
|  function code(){...
|```

when translation file is created, hash:"" to mark not yet translated.

hashing rules

  • section title JSON data removed before hashing
  • code-block JSON data removed before hashing
  • lines: timrEnd (trimRight)
  • emtpy lines removed at the end .... (not sure about this one)