Skip to content

Commit

Permalink
Add syntax highlighting plugin using Pygments.
Browse files Browse the repository at this point in the history
This adds my old Pygments lexer before Jekyll moved to rouge. This is done by using
a Jekyll plugin to call the `pygmentize` binary to convert the code using the lexer
`_FvwmLexer.py` included in the source. Because the plugin is run for each block of
code, a full python environment is loaded each time `pygmentize` is called, which
increases the build times significantly (30seconds on my machine). By default the
plugin will not run `pygmentize`, so this feature needs to be enabled by running:

jekyll build --config _config.yml,_config-fvwm2rc.yml

Since the site is built rarely, implementing a faster method is not work any additional
complexity in using the custom lexer. Also since this is a custom _plugin, this will
not work on githubpages directly.
  • Loading branch information
somiaj authored and ThomasAdam committed Apr 10, 2024
1 parent 78a8786 commit 9ae3281
Show file tree
Hide file tree
Showing 86 changed files with 1,316 additions and 953 deletions.
30 changes: 15 additions & 15 deletions Readme.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
# FvwmWeb (fvwm.org) at GitHub

This is the source to build the Fvwm website, <https://fvwm.org/>,
including the wiki located at <https://fvwm.org/Wiki/>.
This is the source to build the Fvwm website, <https://www.fvwm.org/>,
including the wiki located at <https://www.fvwm.org/Wiki/>.

The site is built from Markdown files with front matter using Jekyll:
<https://jekyllrb.com>.
The site is generated from markdown using Jekyll (including Jekyll's
Kramdown flavor of markdown). See <https://www.fvwm.org/Wiki/FvwmWeb/>
for information on how the site is organized, the styles and plugins used.

To build and view the site locally, you can clone the
repo, then use Jekyll to build the site:
To build and view the site locally, clone the repo, then use Jekyll to
serve the site:

```
```shell
git clone https://github.com/fvwmorg/fvwmorg.github.io.git
cd fvwmorg.github.io
jekyll s
jekyll serve
```

To contribute to the website or wiki, make a pull
request against this repo.

More information about the layout and contributing
to the fvwm.org website and wiki can be found at
<https://fvwm.org/Wiki/FvwmWeb/>.

By default the fvwm2rc syntax highlighter is disabled, as it increases
build times drastically. To build or serve the site with syntax highlighting
use the `--config` option:

```shell
jekyll serve --config _config.yml,_config-fvwm2rc.yml
```
24 changes: 12 additions & 12 deletions Wiki/Config/Bindings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ below FVWM divides the screen up into the following regions.
Any Fvwm command (including custom functions) can be triggered by a
binding. The configuration syntax for Key and Mouse bindings is

{% highlight fvwm %}
{% fvwm2rc %}
Key Name Context Modifier Command
Mouse Button Context Modifier Command
{% endhighlight %}
{% endfvwm2rc %}

The Context describes the current location of the mouse (as shown above).
The Context can contain any number of possible locations such as
Expand All @@ -68,7 +68,7 @@ key must be pressed in addition to the binding. Below is a nice little
ASCII diagram you can put in config file to keep look this info up when
making bindings:

{% highlight fvwm %}
{% fvwm2rc %}
###########
# Contexts:
# R = Root Window rrrrrrrrrrrrrrrrrrrrrr
Expand All @@ -86,14 +86,14 @@ making bindings:
# Key {(window)} [key] [Context] [Modifier] [Action]
# Mouse {(window)} [button] [Context] [Modifier] [Action]
####################
{% endhighlight %}
{% endfvwm2rc %}


## Example Bindings

The following are some example key bindings:

{% highlight fvwm %}
{% fvwm2rc %}
# Keybindings
Key F1 A M Menu MenuFvwmRoot
Silent Key Menu A A Menu MenuFvwmRoot
Expand All @@ -103,7 +103,7 @@ Key F2 A C GotoDesk 0 1
Key F3 A C GotoDesk 0 2
Key F4 A C GotoDesk 0 3
Silent Key Super_R A A Exec exec xterm
{% endhighlight %}
{% endfvwm2rc %}

+ The fist binding opens the menu MenuFvwmRoot with Alt-F1.
+ The second binding opens the menu MenuFvwmRoot with the Menu key.
Expand All @@ -118,28 +118,28 @@ Next is are some mouse bindings. Mouse bindings can be linkned with functions
to control what happens if you Click, Hold, Move, or Double Click.
So in these example bindings we make use of the following functions

{% highlight fvwm %}
{% fvwm2rc %}
# MoveClickX MoveCommand ClickCommand DoubleClickCommand
DestroyFunc MoveClickX
AddToFunc MoveClickX
+ M $0
+ C $1
+ D $2
{% endhighlight %}
{% endfvwm2rc %}

This function is useful because now we can bind things to moves (M), clicks
(C) and double clicks (D) in the same Context (window button, title bar, etc).
Now the mouse bindings.

{% highlight fvwm %}
{% fvwm2rc %}
# Window Button Locations [13579 Title 08642]
Mouse 1 1 A Menu MenuWindowOps
Mouse 1 2 A MoveClickX Nop Close Destroy
Mouse 1 4 A Maximize 100 100
Mouse 2 4 A Maximize 0 100
Mouse 3 4 A Maximize 100 0
Mouse 1 6 A Iconify
{% endhighlight %}
{% endfvwm2rc %}

+ Button 1 (far left) opens MenuWindowOps that can act on the window.
+ Button 2 (far right) is the close button. This use a custom function
Expand All @@ -155,7 +155,7 @@ Next we also have to bind action for when grabing the title bar
to move a window or the window border to Resize it. Notice how
these bindings use different contextes for this.

{% highlight fvwm %}
{% fvwm2rc %}
# Windows Other
Mouse 1 T A MoveClickX Move Raise Maximize
Mouse 1 FS A MoveClickX Resize Raise Nop
Expand All @@ -167,7 +167,7 @@ Mouse 3 R A Menu MenuWindowOpsLong
Mouse 1 I A MoveClickX Move Nop Iconify
Mouse 3 T A Menu MenuWindowOps
Mouse 3 I A Menu MenuIconOps
{% endhighlight %}
{% endfvwm2rc %}

+ Clicking on the title bar allows you to move the window by holding
the button and moving the mouse. Raises the window if you just click
Expand Down
20 changes: 10 additions & 10 deletions Wiki/Config/Colorsets/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@ __all__ Colorsets up to the maximum number used.
For example, define Colorset 2 with a white foreground (fg) and black background (bg)
as follows:

{% highlight fvwm %}
{% fvwm2rc %}
Colorset 2 fg #ffffff, bg #000000
{% endhighlight %}
{% endfvwm2rc %}

In the case no hilight (hi) and shade (sh) are set, fvwm will generate
them when they are being used for the 3D raise/sunk looks. You can set the
Expand All @@ -45,10 +45,10 @@ and blue between 00 and ff (in hexadecimal).
In addition to this format you can also use rgb:rr/gg/bb or color names
such as

{% highlight fvwm %}
{% fvwm2rc %}
Colorset 2 fg white, bg black
Colorset 3 fg rgb:ff/ff/ff, bg rgb:00/00/00
{% endhighlight %}
{% endfvwm2rc %}

Color names are used using rgb.txt from X (/etc/X11/rgb.txt).

Expand All @@ -59,9 +59,9 @@ used. One way is to use CleanupColorsets to reset all the colorsets.
Another is to include additional options to force the defaults. For
example

{% highlight fvwm %}
{% fvwm2rc %}
Colorset 2 fg #ffffff, bg #000000, hi, sh, fgsh, Plain, NoShape, Tint, Alpha
{% endhighlight %}
{% endfvwm2rc %}

This will do almost the exact same thing as the first example without these
additional options. The difference is this example removed any previous definitions
Expand All @@ -78,7 +78,7 @@ One can use any numbering convention for the Colorsets that fits your configs de
If you don't want to create one of your own, here is the one used in the default
config.

{% highlight fvwm %}
{% fvwm2rc %}
######
# 3: Colorsets
#
Expand All @@ -102,7 +102,7 @@ Colorset 5 fg #000000, bg #ffffff
Colorset 6 fg #ffffff, bg #2d2d2d
Colorset 7 fg grey30, bg #ffffff
Colorset 8 fg #ffffff, bg #003c3c
{% endhighlight %}
{% endfvwm2rc %}

## Color Themes

Expand All @@ -122,12 +122,12 @@ between the color themes.
To do this extract each of the above collections into $FVWM_USERDIR ($HOME/.fvwm).
Then to build a menu for CdeColors/* use the following

{% highlight fvwm %}
{% fvwm2rc %}
DestroyMenu CdeColorMenu
AddToMenu CdeColorMenu "Cde Colors" Title
PipeRead 'for i in $[FVWM_USERDIR]/CdeColors/*.fvwm2rc; do \
echo "AddToMenu CdeColorMenu $(basename -s .fvwm2rc $i) Read $i"; done'
{% endhighlight %}
{% endfvwm2rc %}

This menu will Read the file that contains the Colorset definitions when
selected and give you a way to switch between the color themes.
Expand Down
Loading

0 comments on commit 9ae3281

Please sign in to comment.