gsantner / markor

Text editor - Notes & ToDo (for Android) - Markdown, todo.txt, plaintext, math, ..
https://github.com/gsantner/markor/discussions/2269
Other
3.78k stars 363 forks source link

Format: Zim Wiki #393

Closed ghost closed 3 years ago

ghost commented 6 years ago

General information

Description

I was wondering if it would be possible to add support for the zim wiki format. Zim wiki is a notetaking app on desktop. It would be really cool if this app could be the android counterpart to it, using services like syncthing to sync files between them. Here's the site for zim: http://zim-wiki.org

Log

gsantner commented 6 years ago

I'm not using/knowing the format myself, but the project welcomes additonal formats (and supports adding them)! Open for contributions!

JacobyJu commented 5 years ago

I would appretiate this feature too. Would be very nice to edit my zim Notebooks. More about the Syntax can be found here. http://zim-wiki.org/manual/Help/Wiki_Syntax.html

gsantner commented 5 years ago

@Designboy @ManchurianSector @sojusnik @mherrmann3

Having some news about this ;) ! While there are no actions or other implementation, Zim Wiki (.zim) is now a new option in the new New file dialog. Also .zim files will now show up in the Notebook.

As of implementation, free to take. It's best if you guys start on it as you use the format, and know best whats expected and how! Waiting for merge requests :smile: . You can basically just do simple copy paste of the PlainTextFormat folder and add stuff you need.

screenshot_20181208-042553

trevor87 commented 5 years ago

First of all: Great job on markor! Its a really useful app!

Zim support would indeed be great as one could have ones wiki on the phone!

Just my two cents on this: I just saw the Zim Wiki option when creating a new note and tried it out and it turned out that it does not work yet. Wouldn't it be better then to take the option out then as long as it does nothing? For me it was quite confusing..

Greetings

gsantner commented 5 years ago

@trevor87 While youre right that there is no highlighting or other special features for it, you can create,edit and view zim files everywhere in Markor.

This currently uses normal plaintext editing functioanlities as you would work from any device. More format specific funtionalities are planned, but is something that should be done by a interested zim user. (Or somebody that wants to be ;). This issue is not closed or done, btw.

trevor87 commented 5 years ago

Thanks for the quick answer!

Just a note that came up during my research: I checked my zim installation and it seems that ".zim" files are only project files that contain information about the notebook, but no content. Zim stores the content in ".txt" files.

gsantner commented 5 years ago

Oh, good to know that, didnt know this. Makes it even harder due matching happens on file extension. Is then there even a generic way to determine if the .txt is a zim file?

trevor87 commented 5 years ago

Yes, the files begin with:

Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2019-01-14T20:24:08+01:00
silmaril42 commented 5 years ago

I think this might work very similar to the markdown format. The following is a simple Zim document, in which I tried to gather all the possible formats.

Content-Type: text/x-zim-wiki
Wiki-Format: zim 0.4
Creation-Date: 2019-01-28T20:53:47+01:00

====== Zim Wiki ======
Let me try to gather a list of the formatting options Zim provides.

====== Head 1 ======

===== Head 2 =====

==== Head 3 ====

=== Head 4 ===

== Head 5 ==

**Bold**
//italics//
__marked (yellow Background)__
~~striked~~

* Unordered List
* second item
    * [[Sub-Item]]
        * Subsub-Item
            * and one more sub
* Back to first indent level

1. ordered list
2. second item
    a. item 2a
        1. Item 2a1
        2. Item 2a2
    b. item 2b
        1. 2b1
            a. 2b1a
3. an so on...

[ ] Checklist
[ ] unchecked item
[*] checked item
[x] crossed item
[>] Item marked with a yellow left-to-right-arrow
[ ] another unchecked item

This ist ''preformatted text'' inline.

'''
This is a preformatted text block.
It spans multiple lines.
And it's visually indented.
'''

We also have _{subscript} and ^{superscript}.

It seems there is no way to combine those styles.
//**this is simply italic**// and you can see the asterisks.
**//This is simply bold//** and you can see the slashes.
__**This is simply marked yellow**__ and you can see the asterisks.

This is a web link: [[https://github.com/gsantner/markor|Markor on Github]]
Links inside the Zim Wiki project can be made by simply using the [[Page Name]] in double square brackets.
This my also contain some hierarchy information, like [[Folder:Subfolder:Document Name]]

Sorry, I don't have the time or the Java knowledge to dive into this any deeper, but maybe this list is a starting point for someone?

JoelMon commented 5 years ago

Another vote for Zim support. 👍👍

JoelMon commented 5 years ago

If it's any help pandoc has support for MD to Zim

gsantner commented 5 years ago

Thanks everybody for suggestions, but I think we are there were really only code contribtutions help :-).

As noted, this is open and waiting for community contribution.

gsantner commented 5 years ago

@ all: Since Markor v2.0 there is a new option "Template" at creating new files. With the next update (>v2.0.3) this also have an option for zim-wiki. This will create a new file based on common zim-wiki syntax. It is based on @silmaril42 solution, thanks for working on that sample file!

Screenshot_20190722-220257


I'm closing this as implementing Zim format is not on my personal todo. Btw format includes a full suite of syntax highlighter, textactions, converter and others.

However if somebody is (/starts) working on this I'm happy to give feedback, and merge when it's ready. Don't ask for this to be reopened, this issue is now about implementation discussion. (i.e. if you started/start working on it). Thanks!

pfalcon commented 4 years ago

For folks who may be interested in this ticket: I also would like to use Markor as a viewer/editor for my Zim notebooks. But I fully agree with @gsantner that it doesn't make sense to implement support for proprietary Zim markup format. Instead, support for Markdown should be implemented on Zim side, to ensure interoperability of Zim with Markor and many other tools.

I started prototyping such support in my Zim fork, https://github.com/pfalcon/zim-desktop-wiki/tree/pfalcon (at the time of writing, only basic Markdown features are supported, based on what I actually use/need in my notebook. I plan to gradually add more features.) Discussion related to Markdown support in Zim (including my devel notes/updates/questions) are at the upstream issue, https://github.com/zim-desktop-wiki/zim-desktop-wiki/issues/26.

fredericjacob commented 4 years ago

Hello at all! First, thanks @gsantner for this great app and for maintaining it as an open-source project. I am also a heavy ZimWiki user - I'm using a Zim notebook as my personal knowledge base in my everyday life for more than one year now. But I'm also missing a proper mobile client to access my knowledge everywhere.

So I've just started working on adding support for ZimWiki syntax highlighting in Markor (see https://github.com/fredericjacob/markor/tree/zim-highlighting). Thanks @silmaril42 for creating an overview about the syntax elements, I'm using this as an orientation for my implementation right now. The highlighting of some of the basic elements (colored headings, bold, italics, ...) already works.

I'm going to create a pull request when I've made some more progress. :)

@pfalcon I agree that it actually makes sense to have a more "standard" and interoperable markup format for Zim notebooks - good to see that you work on supporting Markdown features in the Zim desktop application! However, I feel that there is still some way to go to actually replace the currently used syntax with something else (at least for production use). It might also be difficult to map some currently used Zim elements to a different format. So I think at the time being it makes a lot of sense to extend Markor with Zim format support, in order to get a working mobile client for Zim notebooks in the near future.

gsantner commented 4 years ago

Hey everybody,

I'm happy to see that it's rolling. Let me know when I can help or describe something.

Whats also interesting - that can also be done by somebody else than frederic - search if there is some java (or javascript) implementation of zim-wiki. So you get a proper beauty View-Mode (html) output.

@fredericjacob thanks for starting. As there was a PR merged yesterday that improved the highlighters, be sure to merge master in. So you not end up with too much conflicts.

I'm reopening the issue as I assume/hope we will get somewhat proper zim support.

pschwede commented 4 years ago

Hi, please see https://github.com/pschwede/markor.git for my attempt to implement (some) Zim-Wiki support for Markor. (Work in progress!)

gsantner commented 4 years ago

Thx! @pschwede @fredericjacob (or anybody else), you can right away create a "WIP:" pull request. Then we can have discussion there and right away elimate bigger things as they appear.