Giter Club home page Giter Club logo

otterwiki's People

Contributors

baldy-cape avatar dependabot[bot] avatar marcrleonard avatar redimp avatar ritzelprimpf avatar shangri26199 avatar weaversam8 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

otterwiki's Issues

Frontend not accessible w/o JavaScript

This is a problem for (at least) my use-case where JS is not always available in the visitors web browser.
Missing JS should not break basic functionality, it should be more like an icing on a cake (in my opinion)

What's not working w/o JS (non-exhaustive list):

  • menu button on the left; menu doesn't open\
  • menu button on the right (next to the search field); menu doesn't open
  • editing an article shows an empty page
    • same goes for creating a new article

tests bug: order matters

There is something broken in the tests, the order of the tests excuted matters and must not.

e.g.

pytest tests/test_attachments.py tests/test_preferences.py

works fine (reference commit 98ead75)

but

pytest tests/test_preferences.py tests/test_attachments.py

fails.

Even using only one method from test_preferences.py and one of test_attachmets.py will make test_app_with_attachments fail:

$ pytest tests/test_preferences.py tests/test_attachments.py -k 'test_admin_form or test_app_with_attachments'
...
platform darwin -- Python 3.10.7, pytest-7.1.3, pluggy-1.0.0
rootdir: /Users/redimp/projects/otterwiki
collected 10 items / 8 deselected / 2 selected

tests/test_preferences.py .                                                                     [ 50%]
tests/test_attachments.py F                                                                     [100%]

============================================== FAILURES ===============================================
______________________________________ test_app_with_attachments ______________________________________

test_client = <FlaskClient <Flask 'otterwiki.server'>>

    def test_app_with_attachments(test_client):
        response = test_client.get("/Test/view")
>       assert response.status_code == 200
E       assert 404 == 200
E        +  where 404 = <WrapperTestResponse streamed [404 NOT FOUND]>.status_code

tests/test_attachments.py:47: AssertionError

Push wiki to remote

Is there a place in the interface the push the wiki to a git remote location? It would be cool if there was a "Push" or "Sync" feature. This could be very tricky if there are remote changes that conflict with local, but it would great to do this in the UI

Nested nav menu

It would be great to be able to navigate content via nested menus.
Initially it can just be 'parent/child' directory, according to how the pages are created.

Long term, one solution could be:

When creating a new page, select it's parent page and sort order.
If no parent page is defined, the page is considered top of the directory tree
Sort order field is numerical only. Sort order starts from 1 (0 reserved for home / root, at very top if tree). Form input is validated to numerics only. No upper numerical value for sort order.
If no sort order is specified, enter a default value of 1
Nav bar sorts parent --> child relationships first numerically, then alphabetically

Inconsistent links in Preview

Currently, the file structure is as follows:

  • Every article is in the root directory of the wiki's articles repository.
  • An attachment attachment.xyz for an article article.md is located in article/attachment.xyz in that root directory.

For linking, we have the following:

  • It is possible to link the article as [linktext](/article) and even [linktext](/article.md)
  • It is possible to link the attachment as [linktext](/article/a/attachment.xyz)

Ideally, I would like to be able to link stuff consistently with how linking would work if I were to view the same markdown files in a text editor that can handle markdown links I made the following observations:

  1. With articles, it is possible to link the article via [linktext](./article) and even [linktext](./article.md), but this is broken in preview mode.
  2. With attachments, it is possible to them as [linktext](./article/a/attachment.xyz), but this is broken in preview mode, whereas [linktext](./a/attachment.xyz) works but only in preview mode while previewing the article article.
  3. It is not possible to link attachments as [linktext](./article/attachment.xyz) or [linktext](/article/attachment.xyz).

(I hope that I didn't make any mistakes)

I suspect the reason for 1 (and the second part of 2) is that in preview mode, a relative path gets appended to the path of the article, which doesn't happen normally.

Also, filenames are automatically made lowercase in the underlying file structure, no matter the casing of the article name in the otterwiki viewer. I can imagine multiple reasons for this, but it might make linking stuff more confusing, since links could break when viewing the files in other markdown viewers that follow the link directly and are therefore case-sensitive. Also, where does otterwiki track how the casing is, if it can't see it in the filename? It seems weird to have extra metadata just for that.

So additionally to the preview bugs, I would personally heavily prefer it if links were made to be compatible with the file structure in a way that any other markdown viewer would handle it for relative paths.

Some thoughts:

  • Make a folder and subfolder for article/a/ for each article and put attachments there? Or is that nonsensical?
  • Have the attachments as it currently is, in the article folder, and have the path name for the http request also as it currently is with /a/ in the path name, but at least have linking work with links with a relative pathname ./article/attachment. The otterwiki viewer could just handle it however it likes, as long as the linking works.

I just want it to be consistent with viewing the markdown files in other settings.

Attachment routing (Links to attachments)

Attachments to a page should be accessible analogous to the file system.

e.g. Home with the attachment example.jpg.

Currently you get

  • with /Home/a/example.jpg the attachment
  • with /Home/t/example.jpg a thumbnail of the attachment
  • with /Home/t/example.jpg/100 a resized (max 100x100) thumbnail of the attachment

Proposed feature: You get

  • with /Home/example.jpg the attachment
  • with /Home/example.jpg?thumbnail a thumbnail of the attachment
  • with /Home/example.jpg?thumbnail=100 a resized (max 100x100) thumbnail of the attachment

This is follows one of the ideas in #39.

scharfes s sz ß at beginning of word in title breaks links in A-Z

when the ß character is in the middle of a word in a title (e.g. straße), everything is fine, however, when it is in the beginning of a word of a title, (e.g. ßuper ding, tolle ßau), the links in the "A-Z" page capitalize it and convert it to an "Ss" (e.g. Ssuper Ding, Tolle Ssau), which breaks the link.

typing in the link by hand works of course.

what is the use case? well, it is not too important, but sometimes it is practical to clump batches of articles together in seperate "categories", so that the "A-Z" page doesn't clutter up, for example "Meeting 2022-11-14" and so on. this is done by using a special symbol at the beginning so that they get sorted after all of the letters. so the titles would be "ß Meeting 2022-11-14" and so on.

this is not very important, we found other special characters like the euro symbol etc, but this is how we found this glitch.

Initial default homepage (in place of 404)

To make the initial app empty app a bit more 'friendly' I think rather than displaying the 404 (which, is quite nice actually), there should be a boilerplate home page. Maybe it can incorporate a bit of the markup guide + an edit button. Just an idea! Feel free to reject it.

Global TOC

As I've been using the wiki, I'm still finding it a bit tricky to get around. There is the alphabetized listing of articles, which is helpful, but I wonder if something more akin to a Table of Contents page would be helpful. This would traverse the created pages (including sub folders) and come up with a hierarchical view.

I have a prototype for this, it includes looking in sub directories and specifying depth. This page would have a slight leg up on the A-Z view, as once sub folder are in and the user starts organizing the wiki, that organization would be clear to see in this view. I will push a PR for you to look at.

Wiki link syntax should not be replaced in `code` etc.

It would be handy to use [[egg]] in certain places without getting replaced by a link. The Wikipedia handles the situation by using HTML encodings of [ (&#91;). That already works except when used inside code, e.g. `[[foo]]`. Probably the same problem with triple ticks.

A possible solution might be to write a lexer for mistune or use a Renderer as described on the mistune README.

In app manual / documentation

Currently there is no manual (apart from the markdown syntax guide) in the app.

Adding a manual available via the "three dot" menu on the navbar.

The manual should be include at least a "User" and an "Admin" Section. The "Markdown Guide" should be part of it, too.

Editor Toolbar

Add a toolbar to the editor that makes writing markdown more accessible with toolbar that provides format macros. For example

image

Subdirectories/folder feature

Hello! I was curious if you had a plan to implement sub-directories/folders. I'd be happy to work on this. This morning I actually dove in to come up with a structure that could work:
image
This will yield:

respoitory/
    home.md
    a_folder/
        a_folder.md

Navigating to the URL of /a_folder will yield /a_folder/a_folder.md (kind of like it's index.html page). This works from some simple matching logic to check if the pagepath you're trying to access is a folder or a page. This moves the 'storage' checking aspect upfront (before crafting the paths on disk).

image

Let me know if you'd like me to proceed with a PR.

Layout Ideas

I feel like given the way some of these types of apps function there are a few design patterns that could be used. Here are some ideas:

  • The left side nav could be a user defined set of pages (maybe there is a default as well) ... Basically, a set of pages that are 'most important' to the user.
  • When in the page view mode, have it be broken into two columns. The left would be the page, and the right would be the table of contents nav. I also moved the edit button into this 'sticky' column. I think it makes more sense to have the edit button encapsulated inside the page rather than part of the nav. See 1st screenshot. (sidenote: this same principal could be applied to the save/preview buttons when in edit view)
  • Since the Markdown Syntax Guide only applies when editing a document, have it be a reference tab at the bottom. See 2nd/3rd screenshot.

Screen Shot 2022-10-01 at 6 28 32 AM

Screen Shot 2022-09-30 at 8 18 39 PM

Screen Shot 2022-09-30 at 8 19 07 PM

Let me know how you like these changes and I will issue a PR

(Auto) save drafts while editing

The editor should (auto) save drafts while editing a page.

Notes:

  • The draft is removed as soon as the page has been comitted.
  • The draft will not be saved in the repository, because this would need a proper commit (and fill up the change log)
  • When a user navigates to a page where a current draft (by the current user) exists, this is displayed with the option to continue editing or to discard the draft. In case updates bu other users happend the page in the meantime, a warning will be displayed.

As discussed in #60.

Error when starting docker container on windows

When following the readme to deploy to docker, the docker container stops with this error:

otterwiki-web-1 | /usr/bin/env: ‘bash\r’: No such file or directory

... I suspect it has to do with the #! /usr/bin/env bash at the top of docker-entrypoint.sh on windows.

changelog pagination overflows

otterwiki_blur

screenshot is taken with window on half screen width 1440p.
when dragging the window wider, at some point this is fixed, but when dragging it narrower, the pagination numbers keep being right justified, making the smaller numbers (especially the 1) not visible.

[feature] differntiate between read and write access for approved users

it might be useful to have read only access for some users and read and write access for some other users.

currently, it is only possible to differentiate between users via being unregistered (anonymous user), registered, approved, and admin. i want to have the wiki be hidden from public, i.e. not give read access to anonymous users, give all approved users read rights, and some users additionally write access. currently, this is only possible by making the latter group of users admins.

it is not an option for me to make registered users have read access and approved users have write access, as anyone could instantly circumvent this by registering. i want to manually approve who can see, and manually approve who can write.

currently, our setup is that we have http authentication (.htpasswd).

Create page in one screen

Really loving otter wiki! It's super simple, which I appreciate. I have a list of "quality of life" features if you're open to PRs 😀

I've found it's somewhat arduous to create a new wiki page. It take 3 clicks steps (name of page, add content, add commit message). I think a really good model for how to do this is how GitHub does it. They have all these things on one page. When you go to submit, if that page exists, it will return this message:

image

I have a handful of other ideas. Should I submit additional issues (I'm happy to work on this, and other enhancements)?

Switch from legacy setup.py to pyproject.toml

With pip 22.3 you get the warning

DEPRECATION: htmlmin is being installed using the legacy 'setup.py install' method,
because it does not have a 'pyproject.toml' and the 'wheel' package is not installed.
pip 23.1 will enforce this behaviour change. A possible replacement is to enable the 
'--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/855

We could install wheel with the pip upgrade in the make venv step of the Makefile, but this feels lazy. Will switch to pyproject.toml.

Running into an issue with URI Linkning

I'm having an issue on my docker instance of the current version of OtterWiki, where the linked URI elements that are entered with header links, do not jump down the page when clicked. They also can't be auto scrolled to when using the #whatever at the end of the URL.

I can sort of cludge this to work by using a "#:~:text=" and then entering the text I'm trying to jump to, but that's a lot less elegant and doesn't fix the sidebar "on this page" links.

From the things I've tried, by forcing a div id/class on a section, it hasn't worked.

Cannot delete lines on mobile

If you edit a page on mobile, go to a random line and delete each character from that line, you cannot use the backspace to delete the line itself.

screen-20231210-031428.mp4

Mathjax/Latex without ticks

Within the code space, in order to execute latex code, two options are available:

  1. Use inline tick marks IE `$x=\frac{-b\pm \sqrt{b^2-4ac}}{sa}$` to yield $x=\frac{-b\pm \sqrt{b^2-4ac}}{sa}$
  2. Use the triple ticks with math extensions

```math
$x=\frac{-b\pm \sqrt{b^2-4ac}}{sa}$
```

for

$$x=\frac{-b\pm \sqrt{b^2-4ac}}{sa}$$

However, other markdown setups can generate the above code without the singe or triple ticks marks. I was wondering, is it posible to have the Markdown logic expand to include latex without requiring tick marks?

Tests Failing

Hello, when I clone the repo, it appears the tests are failing. I'm not sure if this is to be expected or not. The short output is below:

========================================================================================== test session starts ===========================================================================================
platform darwin -- Python 3.8.2, pytest-7.1.3, pluggy-1.0.0
rootdir: /Users/marcleonard/Desktop/otter-o
collected 93 items                                                                                                                                                                                       

tests/test_attachments.py .....                                                                                                                                                                    [  5%]
tests/test_auth.py ............F...........                                                                                                                                                        [ 31%]
tests/test_essentials.py ....                                                                                                                                                                      [ 35%]
tests/test_gitstorage.py .................                                                                                                                                                         [ 53%]
tests/test_helper.py ...                                                                                                                                                                           [ 56%]
tests/test_otterwiki.py .....F....                                                                                                                                                                 [ 67%]
tests/test_preferences.py FFFFF                                                                                                                                                                    [ 73%]
tests/test_preview.py ...                                                                                                                                                                          [ 76%]
tests/test_renderer.py ........F                                                                                                                                                                   [ 86%]
tests/test_util.py .............                                                                                                                                                                   [100%]


Custom Site Logo not working

I am attempting to use a custom site logo and it does not seem to work even though I think I have the configuration correct. I even attempted to make sure it wasn't a permissions issue and made the owner and group of the image file the same user as all the other files in the app-data directory.

There screenshots are from after I saved the configuration. The original site logo disappeared but the one I'm trying to use does not appear.

image

image

Suggestions?

Page name case gets changed between Create page and Editor

If I enter a title like "NAS Setup" on the Create page and click "Create and open in editor" the title gets changed to "Nas Setup", which is incorrect case because it's an acronym and should remain all upper case.

I assume this is because the somethings is trying to give what is seen as "proper" case to the page title but IMO it should not be making this decision for the users. As seen above there are cases where the title may have acronyms or for other reasons the user does not want Pascal Case for the title.

Be able to change Display Name of User

It is not possible to change ones own display name. This should be possible, as everything is managed via git, and git should support that, as users are identified via email address. It would be a nice feature.

Improve the Edit/Preview implementation

How the switching between Editor and Preview currenlty works is far from perfect. I would like to change that in a way like it works in e.g. github. This would solve the issue with loosing the Undo/Redo history as well.

As discussed in #60.

Add 'warning' for pages not under version control (rather than 404)

I ran into an interesting situation. I was moved some .md files from an old repo into my current dev repo, and when trying to navigate to the page I was confronted with a 404. I chased it down the debugger and realized it's because it had not been added under version control (which makes sense why it would fail). Since it was able to load the page just fine from the filesystem (before it raised an exception from git), I was thinking we could add a warning like this:

Screen Shot 2022-10-14 at 7 21 32 PM

Let me know what you think! Happy to submit a PR! I could see this being a useful feature if you are haphazardly throwing .md files in your repo folder.

using history to show older revision displays most current revision instead

when using the history feature to show an older revision, it still shows the most up to date commit. the url clearly shows, that an older revision should be served, e.g. ?revision=d584ac is added to the url, but the content is not correct

the comparison feature works as intended and shows the diff.

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.