chnp-cli

Operators

Operators are used to perform a specific operation in cohls or cohl command. following are few operators.

  1. cohls operators
  2. cohl operators

Cohls Operators

  1. create operator
  2. erase operator
  3. config operator
  4. add operator
  5. pop operator
  6. retitle operator
  7. batch operator

Create

Create operator is used to create a session inside given directory. session object is generated by the create operator. This session object holds information about codes and how to execute the codes. the filename pattern can be extablished within the session object. to run this command we require a arguement which is title. This title is for session object which may be used while printing and exporting the files.

cohls create "practical 11 programs"

Erase

Erase operator is used to delete the session object created for this current working directory. By deleting the session object a new session can be created.

This command expects no arguements.

cohls erase

Config

Config operator is used to make changes in session object where the pattern to execute files is stored. Config command is automatically executed once the create is executed.

Read More about configurations

cohls config

Add

Add operator lets you add a code into the directory session object codes. These are the codes which are exported while printing or exporting.

This expects arguements used in the commands to execute while configs.

If not all required args are passed it may cause unexpected behaviour or error while gatering output of file.

cohls add ...args

arg[i] will be replaced with $i+1 in commands and filename

Pop

Pop operator is used to remove last added code into session codes.

cohls pop

Retitle

Retitle operator lets you overwrite the title on codes. You can use a number as arg to specify the code which you want to retitle. By Default Retitle runs for all of the codes.

cohls retitle num

or

cohls retitle

Addpb

Addpb is used to create a page break in between last added code and next code which will be added.

cohls addpb

Batch adding

Batch adding is used to add all the present files within the directory it selects the file which has same extension as filename while adding is specified.

Batch adding will execute add for all the selected files.

$1 argument will be replaced with the filename without extension.

if want to replace it with filename with extension we can use -ext flag.

cohls batch

OR

cohls batch -ext

Cohl Operators

  1. shelp operator
  2. savepage operator
  3. theme & font change
  4. print operator

shelp

This operator is used to get help about the operators which redirects to commands.md

savepage

This operators saves all added codes as html page to current working directory with the filename as CHNP~$title.html to cwd.

cohl savepage

theme & font

Theme and font lets you set theme of code blocks and font of codes respectively.

Theme

cohl theme

Font

cohl font

print

This command creates localhost web server which serves the page which can be printed to obtain pdf or prints

cohl print