License:
See /shule/Documentation/LICENSE.txt.

Inspiration:

This editor was inspired by Notetab Light for Windows, although it is not affiliated, nor does it use any of Notetab Light's code—and it is for Linux (specifically for Xubuntu 22.04.4 LTS; I like to update it as new Xubuntu versions are released). I loved how Notetab Light had so many configuration options, and tools like the ability to sort ascending, sort descending, indent, etc. When I switched to Linux, the closest thing I could find was SciTE; I used that for a good while before making Shule. In retrospect, newer versions of Nano are configurable to do more of what I wanted to do than SciTE (but I didn't know how to use Nano much, and I wasn't aware of Nano's potential before I made Shule).


Shortcuts:

I try to make shortcuts for most things. There are a few kinds of shortcuts in this program:
• Regular shortcuts (e.g. Ctrl+t to open a new tab)
• Menu compose key codes (e.g. press the menu button and then type ‘asc’ to sort ascending)
• Left win compose key codes (e.g. press the left Windows key and then type ‘a'’ to insert á into the document)

Menu compose key codes are often indicated in parentheses in the menu item text, while left win compose key codes are often indicates in brackets similarly.

For more information on compose key schemes and codes, see Help->Compose key reference, or press Menu and then type ckr.

Most shortcuts are mentioned in the menu. Most others are mentioned in this file. See Help->Search reference for more information on search shortcuts.

Sorting/shuffle/reverse:

There are a variety of ways to sort and order text. You may sort ascending, descending; you may randomize the text; you may reverse the order of the text. If you attempt to sort (or shuffle, etc.) multiple lines, it will sort them by line (and group more deeply indented material with the top-level indent, or the lack of indent if there is one; if the top line of all items sorted has a greater indent than the top-level indent, then it will change that line so it has the number of spaces as the top-level indent). If you attempt to sort a word, it will sort the letters of a word. If you attempt to sort a single line, it will sort the words in the line (unless there are commas, in which case, it will sort items delimited by commas).

If you desire to make it so indents are not grouped with their parent on a multi-line sort, or if you want commas not to delimit sorted chunks on a single-line sort, you can use the following compose key codes (with the menu compose key) to accomplish either of those tasks (the parenthetical statements are not part of the codes, but you’d realize that if you tried to use them):
• psa (sort ascending)
• psd (sort descending)
• psh (shuffle)
• pre (reverse)

Notes:
• `psa` stands for `plain sort ascending`, and so on.
• Tab characters and non-breaking spaces do not count as indents. Use multiple spaces (e.g. four spaces) to indicate an indent.
• Unique sorts are handled separately (there’s a menu item to toggle them on and off), and may be done (or not done) both with plain sorts and grouped sorts.
    ‣ A unique sort is where only unique sort chunks remain after the sort.


Reading:

This program is not only a text editor, but is also designed for reading text. Here are some pertinent features for readers:
• Favorites (for quick access and bookmarking of plain text books on your computer)
• Fullscreen mode
• Margins
• The ability to toggle your set margins on and off
• Autoscroll
• Find
• Document statistics
• Color themes
• UTF-8 encoding support
• Dictionary lookup
• Scripture lookup and/or insertion
• Countdown timers (if you like to read for a certain amount of time)
• Stopwatches (ditto)
• Age calculator (if you see a date and want to know how long ago it was)


Writing:

This program also has writers in mind. There are many features, which should be useful for them. One that may require some explanation as to why it’s there is Toggle no deletions. This makes it so you can’t edit the stuff you’ve written. A lot of writers like to avoid over-editing. It can help you to be more careful with what you’re writing in the first place and/or to not get too hung up on mistakes. There are random name generators if you want help coming up with names on the spot. You can password-protect your files. You can insert a time stamp, which I like to do for journal-writing. You can create file and directory indexes, which is helpful if you want to type up information about a character or something, for future reference (without having to search the story for all those details). A file index would be particular to one book, while a directory index would be pertinent to all the books in the directory.


Emailing:

See Help->Email reference.


Programming:

Obviously, text editors can be helpful for programmers. This one has a number of features designed to accomodate them (not syntax highlighting, however): For instance, if you press F5, it will run your program. This editor was written in Python; so, it has a bias toward programming in Python. You can run Python scripts without saving them (but if you want proper auto-indent of functions and such, you’ll at least want to rename it to something that ends with .py, even if you don’t save it). The file extension is used to determine how to launch or compile the program.


Favorites:

You can save or load favorites. Each favorite represents one or more filepaths, each filepath with a saved location in that document. When you create a favorite you must give it a name. When you load a favorite, you must provide the name in order to load it. While loading one favorite may load any number of files (and your location in those files), you may also have multiple favorites with the same filepath (and optionally different locations in that file).

Example:

So, let’s say you open a book for the first time. It’s Moby Dick, and it’s saved at /home/cynthia/ebooks/moby_dick.txt. If you press Ctrl+d, you will be prompted to type a name for a favorite. You type moby. Then you close the program, go eat lunch and come back. If you don’t remember where moby_dick.txt is (e.g. /home/cynthia/ebooks/moby_dick.txt) it doesn’t matter. Press Ctrl+shift+d to load a favorite. You’ll notice that moby is already in the input box (since it was the last favorite you saved). Press enter. The program will open moby_dick.txt, right at the beginning where you were. Now, let’s say you read several chapters, and want to save your place. To do that, do the same thing you did to make the favorite in the first place: Ctrl+d (it will say moby in the box this time), and press enter. That will update your location.

So, now let’s say you want to save the part where you meet Captain Ahab for the first time, but you don’t want to lose your place. You can do that, but you don’t need mess with the moby favorite. Just make another favorite. Call it ahab or something. When you load moby it’ll take you back to the place where you were reading. If you load ahab, it’ll take you to where you meet Captain Ahab for the first time.

Now, let’s say you write some notes on Moby Dick (and they’re in /home/cynthia/Documents/moby_notes.txt), and you want to load those, too (in another tab), every time you open the moby favorite. While you have moby_notes.txt open, type Ctrl+d and type moby. This will add moby_notes.txt to the moby favorite (and save your location in that document). So, every time you open the mobi favorite it will open both moby_dick.txt and moby_notes.txt. You can also remove a file from a favorite, if desired.


Renaming and deleting files:

Because of the way favorites and certain other features are set up, it is recommended that if you rename files that use these features that you rename or delete them in the editor itself. This will allow them to be renamed in your favorites and such, too. Press F2 while the file is open in the current tab to rename it. Or, type Menu and then type ‘del’ to delete it.

File->Index menu:

This section of the menu is designed for productivity and organization. Indexes accomplish this by creating a directory called ‘indexes.directory’ in the current one and putting files within the directory that correspond to the file in the current tab for file indexes, and that correspond to the whole directory of the current tab for directory indexes. Shortcuts allow for quick access to these files from the parent file (for file indexes) or any file in its directory (for directory indexes). Directory files are something else altogether: they’re just files in the same directory as the open file in the current tab (but there are shortcuts that make it quick and easy to create or open them). Directory files can be treated exactly like normal files, because that’s what they are. File index and directory indexes are special, and are capable of having alias names, but they cannot be added as favorites due to how I didn’t want to bother with the complexity of programming that, as there was a lot of overhead (while directory files can be added as favorites). File and directory indexes have the potential to be expanded dramatically, as they utilize Wikiweb (a separate project of mine); currently, however, the main benefit they derive from Wikiweb is the alias fucntionality. Please do not create directory files in index key folders (they will not become index keys and they may interfere with and/or break the actual index).

Additional Index menu shortcuts:
• Right-click on selected text will open or create a new file index key.
• Control+right-click on selected text will open or create a new directory index key.
• Control+left-click on selected text will open or create a file in the same directory as the open file in the current tab, if one is open.

Wikiweb:

Shule provides an interface to doing text-only data entry with Wikiweb. Wikiweb is an entirely separate project of mine. See the reference for it in <…/shule/wikiweb/documentation.txt>. It uses a system involving nodes, contexts, and relations. A node is functionally comparable with a wiki article. Nodes may be related to each other through contexts. Wikiweb has a text-only data entry system, which allows for the quick creation of complex, related data. Consider it experimental at present.

Wikiweb shortcuts:
• Menu+wde (Process the data entry, which is the selected text, or the whole file if no text is selected.)
• Menu+whe (Export the current Wikiweb project to HTML.)

Web server:

You’ll notice that you can use this program as a web server. Yes, a webserver. Why not?


Download manager:

There’s no menu item for it, but you can sort of use this program as a download manager that utilizes a command-line download utility called axel. The new download feature is handy if you like to make lists of download URLs before/while downloading them (or if you just happen to have a list of them). It also downloads faster than say wget or cURL, since it can use multiple connections. It downloads one file at time; however, you can queue additional downloads when downloads are active. You can optionally specify different download locations for each set of URLs that you queue. You can also optionally specify the number of connections to use while downloading. If you leave out the optional arguments, the defaults (or the previous ones used) will be used. Format:

path to download folder (you can use a tilde to represent your home directory)
an integer (the number of connections)
URL 1
URL 2
URL 3
…

Example:
~/Downloads
7
http://www.archive.org/download/little_maid_provincetown_1211_librivox/little_maid_provincetown_1211_librivox_64kb_mp3.zip
http://www.archive.org/download/scarlet_pimpernel_ks_librivox/scarlet_pimpernel_ks_librivox_64kb_mp3.zip

To invoke and/or queue the downloads, highlight the text (formatted as mentioned above), press Menu and then type `dow`.

This should launch xterm downloading the items with axel. A bash script is what actually does the downloading (so that's why you can append items to it in another thread, since that works in bash scripts). To see the actual bash script and the log file for your downloads, go to `~/.dl_settings`.

Don’t forget that you can use a file chooser to insert paths, if you need to do that (Menu idp).

If your script gets interrupted and Shule doesn't get to finish doing its thing after the bash script completes, you may need to delete the bash script (and/or the `~/.dl_settings` folder) to get the download manager working again. Axel is assumed to be downloading something if the queue is not empty (so, it won’t start if there are already items queued, since it waits for them to finish before starting anything more; it’ll just queue more items instead).


Glob:

You can use Python’s glob module to insert a list of filepaths and/or directory paths (recursively or not) into the text editor. This is useful if you want to create an MP3 playlist, for instance.Use Menu glp to be prompted for a filepath (and then for wildcards in the next input box). So, to create an M3U playlist, try this:

Type Menu glp. Then enter '/home/myhomedirectory/Music' for the path. Then enter '**/*.mp3' to get a list of all paths that end in .mp3. Save it as an M3U file and open it with a music player.

Program weaknesses:

• This program doesn’t handle really long lines of text very well if wordwrap is off (but it handles them really well if wordwrap is on, and it handles really long documents very well).
• The open/save dialogs have something to be desired. I haven’t worked out how to make directories look different from files, yet. Sorry about that. I made my own load/save dialog, because I wanted things that the default Tkinter ones didn’t offer. I still think it’s an improvement.
• The full range of Unicode is not displayed properly (but you can still work with files that have those characters). Understand that they are represented by multiple characters, but you can still copy those (and they’ll be the correct characters on the clipboard). Tkinter doesn’t support those characters at all (hopefully it will some day); I added the feature that lets the editor handle them (even though it can’t display the characters).
• Some of the features I’ve implemented aren’t how I want them to be: e.g. clipboard history. It’s too complicated for me to want to use it all the time. I need to simplify it, somehow.
• It doesn’t open as quickly as say, Leafpad. (If you want a simple, fast text editor, use Leafpad!)
• Tab characters aren’t as supported as tabs comprised of spaces (and it is recommended that you do not use tab characters, since they may, or may not, break some functionality). The tab key produces tabs comprised of spaces already.