Skip to content

Commit

Permalink
Merge pull request #39 from clodman84/new-docs
Browse files Browse the repository at this point in the history
New docs
  • Loading branch information
clodman84 authored Sep 8, 2024
2 parents 3498fe2 + 8bd942e commit 1692920
Show file tree
Hide file tree
Showing 3 changed files with 102 additions and 61 deletions.
99 changes: 38 additions & 61 deletions docs/source/Getting Started.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,41 @@ Getting Started

This may seem somewhat complicated, but it's much easier than it may feel like, so let's dive in!

Installation Of The App
-----------------------

.. note::
lmao fill it in once the app is packaged in an installation file

The installer will be available under the releases tab in GitHub.


File Structure
--------------

The file structure is not too complicated, and only an overview is required for functioning.
Inside the main application folder, there is a folder called *Data*. This folder contains the database, the billed rolls, the autosaved rolls which are in the middle of being billed in JSON format,
and the music used in the :ref:`DJ` window.

.. note::
Billed rolls will have the same name as the loaded rolls, and will contain a specific number of images named in a specific manner in order for printing and delivering
of the snaps to occur.

Loading The Mess List
---------------------

.. note::
This needs to be done only when you have downloaded the app for the first time or when the mess list has changed.

The mess list is a csv file which consists of the ID Numbers, Names, Genders and Hostels of all the students in the college. You can keep it anywhere on your
PC. To load the mess list, drag the :ref:`Logger` window away to reveal the toolbar located on the top of the main app window. Simply click on Tools -> Load Mess List.
PC. To load the mess list, drag the :ref:`Logger` window away to reveal the toolbar located on the top of the main app window. Simply click Tools -> Load Mess List.
Any csv file will appear green. Simply select it. Upon succesful loading, a message will pop up, and za list will be loaded.

.. note::
Brackets are banned in the names of the mess list, and some names do contain them. In such cases, editing the mess list might be required.
It will entail opening the mess list, scrolling to the infamous person, and removing the brackets.
For example, skibidi (toilet) fanum will have to be changed to either skibidi toilet faunum or simply skibidi fanum.

.. image:: MessList.PNG
:width: 800

Expand All @@ -33,66 +58,16 @@ Billing Window
:width: 800
Using this window, you can search for names, IDs, hostels, etc. and bill them accordingly. The billing window comes with a parser built into so you can querry the database of students with more control.
The parser syntax is confounding and stupefying at first, but like all things, when you break it down it becomes easier to grasp.

So, if you directly type out text, the billing window returns a bunch of names, regardless of hostel, year, etc. In order to search for a particular
**ID Number**, you need to enclose it in **forward slashes (/)** (for example, /0758/). For a particular **hostel**, you need to enlcose it in **square brackets ([])** (for example, [GN]).

.. list-table:: Hostel IDs
:widths: 20 5
:header-rows: 1

* - Bhawan
- Code
* - Ashok
- AK
* - Budh
- BD
* - CV Raman
- CVR
* - Gandhi
- GN
* - Krishna
- KR
* - Malviya
- ML
* - Malviya Studio Apartments
- MSA
* - Meera
- MR
* - Ram
- RM
* - Rana Pratap
- RP
* - Shankar
- SK
* - Shrinivas Ramananujan (see the next entry)
- SR
* - Vishwakarma (no one calls it that)
- VK
* - Vyas
- VY


Things get more interesting, though. something like /230758/ is a valid query. So is /0758/ and /A80720/ and /B4A3/, etc.
ID is basically represented in the form **([0-9]{2}|)([a-zA-Z][0-9]|)([a-zA-Z][0-9]|)([0-9]{4}|)** (for example, **22B4A30000**).
Therefore, /20230758/ doesnt work. Neither does a full ID like /2023AAPS0758P/.
Higher degree students (masters and phd) can be found by searching for **H[0-9] (masters) and PHXP (phd)**.

Also, when searching for names, no result will be displayed until three letters are typed out. When three letters are typed out, you get every single name
that contains those three letters. So, typing *ush* will give you *usha*, *kaushik* as well as *kushi*. After that every letter further typed gives a name with those letters in succession. (This is because we use SQLite's fts5 engine with the `trigram <https://www.sqlite.org/fts5.html>`_ tokeniser).

You can also use **& (AND/INTERSECTION)** and **| (OR/UNION)** with your queries. If you type surya | [GN], you get all the people who's name contains surya,
*OR* they live in gandhi. If you type surya & [GN], you get all the people who's name contains surya *AND* they live in gandhi. The evaluation goes from
left to right, and *unions are the outermost statement*, meaning *it will be evaluated with the least priority*. Brackets can also be added, which adds priority
(surya | [GN]) & /0758/ will evaluate the brackets first, and then move on.

As an example,
**ram & /b4/ & [GN]|[KR]** queries all the people with ram in their name *AND* have the b4 branch *AND* live in gandhi, *OR* the people living in krishna.
Basically it becomes **(ram & /b4/ & [GN])|([KR])**.

.. image :: Parser.webp
:width: 800

The process for billing is fairly simple. A "roll window" opens up along with the billing window, and displays the images.
Using the detailed roll books, one can simply type the ID number of a person, click the same "ID button" from the list that pops up, and watch it get added in the "billed list".
After billing one image with all the ID numbers, clicking next displays the next image, while preserving the billed image's status.

After all the images have been billed, simply click export (located in the billing window, in the same horizontal position as the search bar), and the roll is billed!
The exported roll will be stored in the Data folder, inside the main application folder.


There is a syntax for searching in the billing window, and it utilizes full-text search (fts) to aid it. Link to the page -> :ref:`Search Syntax`


.. _Logger:
Expand All @@ -105,6 +80,8 @@ The Logger, as the name implies, logs stuff! Nothing escapes its sight. You can
.. image:: Logger.PNG


.. _DJ:

Music
-----

Expand Down
63 changes: 63 additions & 0 deletions docs/source/Search Syntax.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
.. _Search Syntax:

Search Syntax
=============

If you directly type out text, the billing window returns a bunch of names, regardless of hostel, year, etc. In order to search for a particular
**ID Number**, you need to enclose it in **forward slashes (/)** (for example, /0758/). For a particular **hostel**, you need to enlcose it in **square brackets ([])** (for example, [GN]).

.. list-table:: Hostel IDs
:widths: 20 5
:header-rows: 1

* - Bhawan
- Code
* - Ashok
- AK
* - Budh
- BD
* - CV Raman
- CVR
* - Gandhi
- GN
* - Krishna
- KR
* - Malviya
- ML
* - Malviya Studio Apartments
- MSA
* - Meera
- MR
* - Ram
- RM
* - Rana Pratap
- RP
* - Shankar
- SK
* - Shrinivas Ramananujan (see the next entry)
- SR
* - Vishwakarma (no one calls it that)
- VK
* - Vyas
- VY


Things get more interesting, though. something like /230758/ is a valid query. So is /0758/ and /A80720/ and /B4A3/, etc.
ID is basically represented in the form **([0-9]{2}|)([a-zA-Z][0-9]|)([a-zA-Z][0-9]|)([0-9]{4}|)** (for example, **22B4A30000**).
Therefore, /20230758/ doesnt work. Neither does a full ID like /2023AAPS0758P/.
Higher degree students (masters and phd) can be found by searching for **H[0-9] (masters) and PHXP (phd)**.

Also, when searching for names, no result will be displayed until three letters are typed out. When three letters are typed out, you get every single name
that contains those three letters. So, typing *ush* will give you *usha*, *kaushik* as well as *kushi*. After that every letter further typed gives a name with those letters in succession. (This is because we use SQLite's fts5 engine with the `trigram <https://www.sqlite.org/fts5.html>`_ tokeniser).

You can also use **& (AND/INTERSECTION)** and **| (OR/UNION)** with your queries. If you type surya | [GN], you get all the people who's name contains surya,
*OR* they live in gandhi. If you type surya & [GN], you get all the people who's name contains surya *AND* they live in gandhi. The evaluation goes from
left to right, and *unions are the outermost statement*, meaning *it will be evaluated with the least priority*. Brackets can also be added, which adds priority
(surya | [GN]) & /0758/ will evaluate the brackets first, and then move on.

As an example,
**ram & /b4/ & [GN]|[KR]** queries all the people with ram in their name *AND* have the b4 branch *AND* live in gandhi, *OR* the people living in krishna.
Basically it becomes **(ram & /b4/ & [GN])|([KR])**.

.. image :: Parser.webp
:width: 800
1 change: 1 addition & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This newer version aims to be easy to update and maintain, and contributions fro
:caption: Contents:

Getting Started
Search Syntax

Indices and tables
------------------
Expand Down

0 comments on commit 1692920

Please sign in to comment.