From 53b621cbe66b8a485419c7a249de82403b0097ce Mon Sep 17 00:00:00 2001 From: "Michael D. Lowis" Date: Wed, 18 Dec 2019 13:31:18 -0500 Subject: [PATCH] tweaked doxygen page layout --- .gitignore | 2 +- Doxyfile | 2 +- DoxygenLayout.xml | 226 +++++++++++++++++++++++++++++++++++++++++++ README.md | 68 ++++++++++++- TODO.md | 27 +++--- bin/pfind | 6 -- bin/rctags | 2 - bin/trim | 2 - bin/xman | 7 -- docs/c_scripts.md | 0 docs/debugging.md | 0 docs/edit_scripts.md | 0 docs/pick_scripts.md | 0 docs/sys_design.md | 1 + inc/stdc.h | 42 +------- src/anvil.c | 5 +- src/edit.c | 5 +- src/edit.md | 1 + src/fetch.c | 5 +- src/fetch.md | 1 + src/fetchsel.c | 5 +- src/fetchsel.md | 1 + src/lib/buf.c | 5 + src/pick.c | 5 +- src/pick.md | 3 + src/registrar.c | 5 +- src/registrar.md | 1 + src/tide.c | 6 +- src/tide.md | 2 + src/tsed.c | 5 +- 30 files changed, 361 insertions(+), 79 deletions(-) create mode 100644 DoxygenLayout.xml delete mode 100755 bin/pfind delete mode 100755 bin/rctags delete mode 100755 bin/trim delete mode 100755 bin/xman create mode 100644 docs/c_scripts.md create mode 100644 docs/debugging.md create mode 100644 docs/edit_scripts.md create mode 100644 docs/pick_scripts.md create mode 100644 docs/sys_design.md create mode 100644 src/edit.md create mode 100644 src/fetch.md create mode 100644 src/fetchsel.md create mode 100644 src/pick.md create mode 100644 src/registrar.md create mode 100644 src/tide.md diff --git a/.gitignore b/.gitignore index 87035ea..a4b4381 100644 --- a/.gitignore +++ b/.gitignore @@ -57,4 +57,4 @@ bin/anvil build/ bin/fetchsel pick -tide \ No newline at end of file +tidehtml/ diff --git a/Doxyfile b/Doxyfile index 4298901..fcc7c21 100644 --- a/Doxyfile +++ b/Doxyfile @@ -741,7 +741,7 @@ FILE_VERSION_FILTER = # DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE # tag is left empty. -LAYOUT_FILE = +LAYOUT_FILE = DoxygenLayout.xml # The CITE_BIB_FILES tag can be used to specify one or more bib files containing # the reference definitions. This must be a list of .bib files. The .bib diff --git a/DoxygenLayout.xml b/DoxygenLayout.xml new file mode 100644 index 0000000..e2da3f2 --- /dev/null +++ b/DoxygenLayout.xml @@ -0,0 +1,226 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/README.md b/README.md index 2f9031f..40c3505 100644 --- a/README.md +++ b/README.md @@ -1 +1,67 @@ -Hi! \ No newline at end of file +# Tide Text Editor + +A minimal text editor inspired by the Acme text editor from Plan 9. + +## Building + +**Build Prerequisites:** + +* A Unix-like environment +* Ruby 2.5.1 or greater + +Execute the following command to produce all of the binaries into bin/: + + make + + +## Installation + + # optionally set the prefix for where it will be installed (*Default:* /usr/local/) + export PREFIX=$HOME + + # build and install + make install + +## Usage + + edit file1 file 2 file3 + +## System Overview + +* [System Design Document](docs/sys_design.md) +* [Software Architecture Document](google.com) + +## Executable Overview + +### Compiled Executables + +| Executable | Description | +|-----------------------|--------------------------------------------------| +| @ref edit | Main executable used to open files for editing | +| @ref fetch | Executes pattern matching rules on input text | +| @ref fetch "Fetchsel" | Executes pattern matching rules on selected text | +| @ref pick | Performs fuzzy search on a set of strings | +| @ref registrar | Tracks open windows and the files they contain | +| @ref tide | The main tide editor executable | + +### Helper Scripts + +| Executable | Description | +|-----------------------------------|----------------------------------------------------------------| +| [E-S and S-E](docs/c_scripts.md) | Convert C functions between static and extern scoping | +| [c+ and c-](docs/edit_scripts.md) | Comment and uncomment selected text | +| [fcomplete](docs/pick_scripts.md) | Uses @ref pick to complete a file or directory path | +| [findall](docs/edit_scripts.md) | Find all occurrences of a string in the project or directory | +| [grepn](docs/edit_scripts.md) | Executes grep -n on input and outputs to a new window | +| [i+ and i-](docs/edit_scripts.md) | Indent or deindent input text | +| [jmpsrc](docs/c_scripts.md) | Jump between related C source and header files | +| [lang](docs/edit_scripts.md) | Determine by extension the programming language of source file | +| [no-c++](docs/c_scripts.md) | Convert all C++ style comments to C style comments | +| [pickexec](docs/pick_scripts.md) | Uses @ref pick to find and execute an command in $PATH | +| [pickfile](docs/pick_scripts.md) | Uses @ref pick to find and open a file for editing | +| [picktag](docs/pick_scripts.md) | Uses @ref pick to jump to a symbol using CTags index file | +| [term](docs/edit_scripts.md) | Executes command shell in @ref tide in pseudo-terminal mode | +| [tofn](docs/c_scripts.md) | Converts C function prototypes to function definitions | +| [view-telem](docs/debugging.md) | Prints @ref tide telemetry data to stdout for debugging | +| [w+ and x+](docs/edit_scripts.md) | Marks the current file as writable and/or executable | + diff --git a/TODO.md b/TODO.md index a2c134f..0144b70 100644 --- a/TODO.md +++ b/TODO.md @@ -1,8 +1,8 @@ # Issue List -## VERIFYING +### VERIFYING -## STAGING +### STAGING * tide: point should be added to editlog to ensure undo/redo behave appropriately * picktag: reimplement in C using binary search @@ -12,7 +12,7 @@ * all: eliminate multiple return statements and other lint * tide: byrune, byword, byline functions should be hidden in buf.c -## BACKLOG +### BACKLOG * tide: commands unadorned by a sigil should direct output to new scratch window * tide: gap buffer does not handle UTF-8 currently @@ -50,12 +50,15 @@ Maybe think about addressing these later: * right click negative numbers should jump to that many lines from the end of file Mouse Chords: -1P Move the cursor -1P 1R 1P Select clicked on word -1P 1R 1P 1R 1P Select whole non whitespace thing -2P 2R Execute clicked word -2P 1P 2R Execute clicked word with argument -3P 3R Fetch clicked word -3P 1P 3R ?? Go to definition ?? -1P 2P 2R Cut the selected text -1P 3P 3R Paste the selection + +| Sequence | Action | +|----------------|------------------------------------| +| 1P | Move the cursor | +| 1P 1R 1P | Select clicked on word | +| 1P 1R 1P 1R 1P | Select whole non whitespace thing | +| 2P 2R | Execute clicked word | +| 2P 1P 2R | Execute clicked word with argument | +| 3P 3R | Fetch clicked word | +| 3P 1P 3R | ?? Go to definition ?? | +| 1P 2P 2R | Cut the selected text | +| 1P 3P 3R | Paste the selection | diff --git a/bin/pfind b/bin/pfind deleted file mode 100755 index 5f4a64a..0000000 --- a/bin/pfind +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -path="$PWD" -while [ "$path" != "" ]; do - find "$path" -maxdepth 1 -mindepth 1 "$@" - path="${path%/*}" -done diff --git a/bin/rctags b/bin/rctags deleted file mode 100755 index 73709a7..0000000 --- a/bin/rctags +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -ctags -R --exclude="mock*" --exclude="test_*" diff --git a/bin/trim b/bin/trim deleted file mode 100755 index 4857571..0000000 --- a/bin/trim +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -sed 's/[ ]*$//g' "$@" diff --git a/bin/xman b/bin/xman deleted file mode 100755 index 38677b7..0000000 --- a/bin/xman +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash -mandir=$(mktemp -d "${TMPDIR:-/tmp/}man.XXXXXXXXXXXX") -man -Pcat "$1" > "$mandir/$1" -{ - tide "$mandir/$1" & disown -} &> /dev/null - diff --git a/docs/c_scripts.md b/docs/c_scripts.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/debugging.md b/docs/debugging.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/edit_scripts.md b/docs/edit_scripts.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/pick_scripts.md b/docs/pick_scripts.md new file mode 100644 index 0000000..e69de29 diff --git a/docs/sys_design.md b/docs/sys_design.md new file mode 100644 index 0000000..5a41b48 --- /dev/null +++ b/docs/sys_design.md @@ -0,0 +1 @@ +# Tide System Design \ No newline at end of file diff --git a/inc/stdc.h b/inc/stdc.h index ad1c752..8630a4a 100644 --- a/inc/stdc.h +++ b/inc/stdc.h @@ -142,31 +142,6 @@ static inline char* _getopt_(int* p_argc, char*** p_argv) { #define OPTLONG \ case '-' -/* Error Handling - *****************************************************************************/ -#define trace() \ - fprintf(stderr, "%s:%d\n", __FILE__, __LINE__) - -#ifdef NDEBUG - #define debug(msg, ...) \ - ((void)0) -#else - #define debug(msg, ...) \ - fprintf(stderr, "DEBUG %s:%d: " msg "\n", __FILE__, __LINE__, ##__VA_ARGS__) -#endif - -#define errnostr() \ - (errno == 0 ? "None" : strerror(errno)) - -#define print_error(msg, ...) \ - fprintf(stderr, "[ERROR] (%s:%d: errno: %s) " msg "\n", __FILE__, __LINE__, errnostr(), ##__VA_ARGS__) - -#define check(expr, msg, ...) \ - if(!(expr)) { print_error(msg, ##__VA_ARGS__); errno=0; goto error; } - -#define sentinel(msg, ...) \ - { print_error(msg, ##__VA_ARGS__); errno=0; goto error; } - /* Miscellaneous *****************************************************************************/ #ifndef nelem @@ -179,20 +154,6 @@ static inline char* _getopt_(int* p_argc, char*** p_argv) { ((type*)((uintptr_t)obj - offsetof(type, member))) #endif -#define concat(a,b) \ - a##b - -#define ident(a) \ - concat(id, a) - -#define unique_id \ - ident(__LINE__) - -#ifndef static_assert - #define static_assert(expr) \ - typedef char unique_id[( expr )?1:-1] -#endif - #ifndef min #define min(x,y) \ ((x) < (y) ? (x) : (y)) @@ -203,4 +164,7 @@ static inline char* _getopt_(int* p_argc, char*** p_argv) { ((x) > (y) ? (x) : (y)) #endif +#define UNITTEST(name) \ + void unittest_##name(void) + #pragma GCC diagnostic pop diff --git a/src/anvil.c b/src/anvil.c index 3db6ffe..6a1b2eb 100644 --- a/src/anvil.c +++ b/src/anvil.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup anvil +*/ #include #include #include diff --git a/src/edit.c b/src/edit.c index 6b070ac..098bee1 100644 --- a/src/edit.c +++ b/src/edit.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup edit +*/ #include #include diff --git a/src/edit.md b/src/edit.md new file mode 100644 index 0000000..3c63c70 --- /dev/null +++ b/src/edit.md @@ -0,0 +1 @@ +@defgroup edit diff --git a/src/fetch.c b/src/fetch.c index 28426ba..322a0af 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup fetch +*/ #include #include #include diff --git a/src/fetch.md b/src/fetch.md new file mode 100644 index 0000000..fcc5664 --- /dev/null +++ b/src/fetch.md @@ -0,0 +1 @@ +@defgroup fetch diff --git a/src/fetchsel.c b/src/fetchsel.c index 5784b21..5cd4576 100644 --- a/src/fetchsel.c +++ b/src/fetchsel.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup fetch +*/ #include #include diff --git a/src/fetchsel.md b/src/fetchsel.md new file mode 100644 index 0000000..bb77c33 --- /dev/null +++ b/src/fetchsel.md @@ -0,0 +1 @@ +@addtogroup fetch diff --git a/src/lib/buf.c b/src/lib/buf.c index 017e49a..e7853f8 100644 --- a/src/lib/buf.c +++ b/src/lib/buf.c @@ -9,6 +9,11 @@ #include #include "config.h" +UNITTEST(foo) +{ + +} + #ifndef NDEBUG static bool buf_valid(Buf* buf) { diff --git a/src/pick.c b/src/pick.c index b6dccb8..4db071a 100644 --- a/src/pick.c +++ b/src/pick.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup pick +*/ #include #include #include diff --git a/src/pick.md b/src/pick.md new file mode 100644 index 0000000..bae68eb --- /dev/null +++ b/src/pick.md @@ -0,0 +1,3 @@ +@defgroup pick + +# PICK COMMAND \ No newline at end of file diff --git a/src/registrar.c b/src/registrar.c index 43ff8a2..4629b55 100644 --- a/src/registrar.c +++ b/src/registrar.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup registrar +*/ #include #include #include diff --git a/src/registrar.md b/src/registrar.md new file mode 100644 index 0000000..3c769bd --- /dev/null +++ b/src/registrar.md @@ -0,0 +1 @@ +@defgroup registrar diff --git a/src/tide.c b/src/tide.c index d17b9a5..40274be 100644 --- a/src/tide.c +++ b/src/tide.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup tide +*/ #include #include #include @@ -16,6 +19,7 @@ typedef struct { char* tag; void (*action)(char*); } Tag; + void exec_init(Tag* p_tags); void exec_cmd(char* cmd); void exec_cmdwarg(char* cmd, char* arg); diff --git a/src/tide.md b/src/tide.md new file mode 100644 index 0000000..7b15c10 --- /dev/null +++ b/src/tide.md @@ -0,0 +1,2 @@ +@defgroup tide +HI2! diff --git a/src/tsed.c b/src/tsed.c index 604c70a..5af4780 100644 --- a/src/tsed.c +++ b/src/tsed.c @@ -1,4 +1,7 @@ -/** @file */ +/** + @file + @ingroup tsed +*/ #include #include #include -- 2.52.0