LibreLingo icon indicating copy to clipboard operation
LibreLingo copied to clipboard

static HTML page with all the course content

Open szabgab opened this issue 2 years ago β€’ 11 comments

During course development it is very useful to be able to see all the words we have already defined in the course and all the Phrases we have for each word. Looking from the other side it is useful to be able to find the words that were not used in any phrases yet.

Students could also use such page to find words and the skills that have phrases with the given word.

For this I propose a set of static pages hosted on https://librelingo.app/ at a URL structure mirroring the courses. For example the course https://librelingo.app/course/spanish-from-english/ would have its pages under https://librelingo.app/dev/spanish-from-english/ This would probably make it easy to avoid any unwanted interaction with the application.

On the main page there would be a list of all the words in the course (in the target language). Next to each word there would be numbers showing how many times they appeared in the Words/Mini-Dictionary/Phrases sections. Each word would be a link to a page containing all the information about that word:

  • Translations from the Word and Mini-Dictionary sections

  • All the Phrases that contain the word

  • There will be links to the git repository of the skill containing the specific definitions. (at least for GitHub-based courses)

  • There will be links to the skills e.g. https://librelingo.app/course/spanish-from-english/skill/animals/

I've started to experiment with such a script generating such a set of pages. It is in this repo: https://github.com/szabgab/LibreLingo-tools

szabgab avatar Dec 25 '21 14:12 szabgab

So this is basically a dictionary page? :thinking:

It could basically be a page that has a table like this:

word meaning links Skills
manzana apple Examples Learn Food, Nature
hablaba talked Examples Learn Past
EspaΓ±a Spain Examples Learn Travel, History
la the, her, it Examples Learn Pronouns

kantord avatar Dec 28 '21 21:12 kantord

Good suggestion for the format.

What I have so far is hosted here: https://github.szabgab.com/lili/ I keep working on it for now here, but at one point we can move it over to https://librelingo.app/ and merge the code into the main repo, if you like.

szabgab avatar Dec 29 '21 09:12 szabgab

Good suggestion for the format.

What I have so far is hosted here: https://github.szabgab.com/lili/ I keep working on it for now here, but at one point we can move it over to https://librelingo.app/ and merge the code into the main repo, if you like.

this looks absolutely amazing!!!!

I think it should be merged into the main repo. Actually even in its current state it can be deployed on the main deployment. Simply running you script at the end of the deployment step and copying the results in the correct folder should do it.

Afterwards maybe the next step is to convert the output format into JSON files. Then it can be connected to the existing frontend and we can make it look a bit more integrated in the current frontend.

kantord avatar Dec 29 '21 17:12 kantord

btw, I see a large amount of overlap with this issue: https://github.com/kantord/LibreLingo/issues/1851

basically this feature can be implemented using what your script does. If we export the word list to json as well, it can even be filtered on the frontend using fuzzy search. Something like this: https://fusejs.io/demo.html

at least this search feature seems to be possible for me! πŸ€” unless maybe some languages have an insanely large number of words πŸ€”

kantord avatar Dec 29 '21 17:12 kantord

Currently there is a GitHub Action in a private repo that runs every hour and regenerates the html file that are hosted on GitHub pages.

For now I'd like to be able to keep moving forward with this without waiting for pull-requests so can move fast and experiment with the code and the output. So if we move over the code I'd like to get commit bit.

We could also stay in separate repos for the time being and I could try to automatically sync with the look-and-feel of the application.

Even if we stay with the current setup we could already configure a subdomain, eg. https://dev.librelingo.app/ and map it to this github repo and then we could let the search engines index it and start getting value out of that.

szabgab avatar Dec 30 '21 07:12 szabgab

I have several other ideas for this tool:

  • Create a mapping of word dependencies among skills
  • Create a list of all the English sentences from all the courses and show which sentences are missing from the "English to Whatever" course that exist in other "English to Something Else" course. This could be used to help learn from each-other and reduce the headache to come up with sentences.
  • A word-mapper or "word-by-word translator" where one could paste a sentence in language X and get a translation for each word to language Y showing which words are missing. This could help a course developer a lot finding out which words need to be added to the dictionary and which words might need examples.

szabgab avatar Dec 30 '21 07:12 szabgab

So if we move over the code I'd like to get commit bit.

you mean authorization to merge directly? you can get such authorization for sure.

I am also not against having multiple repos and using subdomains :thinking: though it could get just a little bit tricky :thinking: for some reason for now I really like the monorepo model. I think it makes development a lot easier

kantord avatar Dec 30 '21 07:12 kantord

One big argument for the monorepo model is that everything is in one place and managed from one place. If anything breaks it can be fixed in one repo. If it's spread out in multiple repos, then you first have to find the relevant repo, find what breaks, fix, get the fix merged by the owner of said repo etc etc.

Whereas right now at least I take responsibility to make sure that everything is up and running. And I also easily have control over everything I need to fulfill this role and responsibility.

kantord avatar Dec 30 '21 07:12 kantord

As I said I am ok merging the code into the main repo. Yes, authorization to merge directly. Please set it up and then I'll move over the code. I can then change my other repo where I have the GitHub Action to create the current web site to use the source code from the main repo. That will make it easier as we don't need any further integration yet.

szabgab avatar Dec 30 '21 07:12 szabgab

The following line generates the static HTML pages:

python apps/tools/generate.py --courses apps/tools/courses.json --outdir docs

This generates the files in the docs directory.

It could be part of a new pipeline that runs every hour or even more frequently and deploy the files in let's says the /dev path of the website.

szabgab avatar Dec 30 '21 19:12 szabgab

So basically this is now deployed at https://librelingo.app/course-tools-legacy/

kantord avatar Jan 16 '22 12:01 kantord