VerzatileDevOrg/Programming_HandBook

[Discussion]: Add + Organize language specific Examples and Implementations

Closed this issue · 2 comments

While we currently have some examples in our "Concepts" folder, it would make sense to include different language's examples rather than defaulting to whatever is easiest (where applicable, as some languages do not utilize certain concepts, for example OOP).
Discuss:

  • Default language for examples
  • Folder structure and organization (do we want to duplicate pages but with language specific examples)
  • See if there is a way to implement multiple language examples on the same page? (Maybe a dropdown to swap to that language)

I have added another method to the feature " https://github.com/VerzatileDev/Programming_HandBook/tree/main "on my specific fork branch.

Additionally added a feature that adds an event listener and saves the current language to the users local storage, if not defiend previously.

If it is defined it loads the selected language from this example Cpp or Csharp.

Which will be asked each time a refresh is called or page is reloaded.

Additionally Pressing the Button either cpp or Csharp will rewrite the Language Preference and store it to locally.

Note:

This Requires that the JavaScript would be made globally not for each instance where possible.

Make sure that only specified buttons are called so make cases if there are less or more languages.

" in the future figure out where to store these as all in the same file would be an overkill potentially ".

See the following addressed in the pull request " #68 " Language Specific examples. The following addresses the issue in a basic way as a concept of how it could be handled, though would require it to be accessible globally, which requires a selection of what types are shown based on the available " <div Id " defined in the .md file.