Documentation ... A New Hope (Starwars reference)

Hey Frappsters!

I’m making this app for the Garments Industry and getting to the point that I need to start thinking about documentation. At first I spun up a site on FrappeCloud and installed Frappe Wiki on it. Managed to create Documentations but quickly realized how difficult it would be to keep them all looking with similar formatting not to include how tedious it would be to update on each feature improvement. Nothing against wiki’s personally but its not the best solution for documentation. So then I found GitBook and it has an interesting concept, create a folder in your project directory called docs, and throw a bunch of markdown files, GitBook will read them sync and show them on their website.

Markdown is fantastic as it eliminates the formatting issue I discussed. And since the documentation lies in my project structure I can even use AI to update the documentation on each feature update. Which simplifies the workload.

Then I went ahead and updated each doctype to link to the external documentation only to realize that in V16 this feature seams to have been ignored and doesn’t show (as in 15 it was working).

Ok so by this point, i’m like WTF. Then it hit me … since the documentation is residing on my project, why don’t i just show the user the documentation as a popup?

This popup opens up whenever the current doctype has a documentation in the folder. It opens by clicking a (?) button placed next to the print and heart on each doctype.

Features:

  1. Auto Detect your Doctype and open on that documentation
  2. Full text search
  3. Option to view as Tree or Focus (Drill-down)
  4. Full Screen View
  5. Side Screen View (great for following along with steps, so you can work on the doctype as you read)
  6. Minimize View (get it out of the way but still present).
  7. Keeps on page even during Navigation.
  8. Ability to Increase or Decrease Font Sizes.
  9. Light and Dark modes matching your theme.

Here is the Side Screen View, allowing users to follow instructions as they are actively working on the site.

Benefits??

The biggest one I can think of, Frappe and ERPNext’s documentation is not great. But its hard for it to be great when updates are coming multiples times a week. You can complain about it, but honestly I tried to maintain documentation but its horrible especially when things are changing so often. Within weeks the code and documentations stop matching up.

But some of the benefits I found when doing it like this:

  • The Version of Documentation is consistent with the version installed. Imagine someone is stuck on version 15, but all online documentation’s have been updated to V16. When the documentation resides in your project … your documentation is always up to date with whatever version you are on.
  • You can program AI to update the documentation which each feature upgrade, making it easy to keep updated docs even when things are changing quickly.
  • Its totally localizable (instead of relying on translations via db or csv files) because you root folder inside docs is your language selector. docs/en for english, docs/es for spanish, etc.
  • This structure is then easy to integrate with third party software like GitBook or create Frappe’s very own Documentation library in the future as reading MD files is a no brainer. Plus it will help with SEO and future AI learning as the documentation is not db reliant. So in the future AI can get trained on your app and help users navigate and do things.

WHY am I showing you this???

Here is my proposal. If there is interest from the community and frappe team as well. I can fork and push an update on Frappe to include this as a default feature. We can design it so that whatever app its on, lets say ERPNext, HRMS, CRM, or any of the other 1000s of projects in frappeverse the doctype is always registered to an App.

  • Each App can have its own documentation and we can seamlessly show it through one UI.
  • This folder structure is generic and can be integrated to many third party apps.
  • ERPNext can finally have a Documentation that is worthy of the product.

But I really need to know if this is something frappe wants, as I’m not a fan of doing this and getting rejected down the line. So @rmehta and @sohamkulkarni looking at both of you.

Looking towards the future, we can make the doc interactive by actively hooking actions and showing the user what to do next. Like a checkbox or wizard. Sky’s the limit. Let me know what you think or ideas to make it better. Regardless of interest from the community, this is something i’ve already implemented in my app. In my opinion it looks great and helps end users (non techy end users).

1 Like

Hi,

Which version of Wiki did you install? :eyes:

Even Wiki v2 was markdown, v3 takes it to next level with a much better authoring and editing experience. Though I like your idea of the pop up :ok_hand:t3:

One thing I would like to work on is a native git integration for syncing docs from codebase, which shouldn’t be hard with the new tree structure base.

1 Like

Using latest Wiki v3 i think. When you click edit on the Wiki UI it shows a Richtext box field. Which isn’t ideal. But your right, after you mentioned it I do remember having to go into desk, search up wiki document, and editing from the desk and it shows up as markdown. But thats the only place this happens. Regardless the files are stored in db which is not great for SEO or AI Learning.

I still feel that having the documentation along with the code is the best long term solution. In the future we extract the docs from there and show in third party solutions or build our own in house solutions.

What your saying is interesting but automating merges is a complicated endeavour. For something like that I would avoid allowing user to edit MD files on the site and just pull changes and let git handle conflicts.

PD: I’m also struggling a bit with wiki v3 because it doesn’t prioritize markdown from the UI.

Yes, that would be great, i see that a developer self assigned it to themselves two years ago, but doesn’t seem to have gone anywhere. Do you recomend I just develop the code and push it to frappe? This in my opinion should always be a frappe feature as it can then be reused by all apps current and future.