Skip to content
This repository has been archived by the owner on Nov 26, 2022. It is now read-only.

Clarification on gophermap grammar #11

Open
sternenseemann opened this issue Dec 28, 2020 · 1 comment
Open

Clarification on gophermap grammar #11

sternenseemann opened this issue Dec 28, 2020 · 1 comment

Comments

@sternenseemann
Copy link

sternenseemann commented Dec 28, 2020

From the man page pygopherd(8) (shortened):

       The gophermap files contain two types of  lines,  which  are  described
       here  using  the  same  convention normally used for command line argu-
       ments.  In this section, the symbol \t will be used to indicate  a  tab
       character, Control-I.

        full line of informational text


        gophertypeDESCRIPTION [ \tselector [ \thost [ \tport ] ] ]


       Note:  spaces  shown above are for clarity only and should not actually
       be present in your file.

       […]

       The  second  type of line represents a link to a file or directory.  It
       begins with a single-character  Gopher  type  (see  Gopher  Item  Types
       below)  followed  immediately  by  a  description  and a tab character.
       There is no space or other separator between the gopher  type  and  the
       description.  The description may contain spaces but not tabs.

Following the paragraph on the second type of line, shouldn't be the grammar read like the following?

        gophertypeDESCRIPTION \t [selector [ \thost [ \tport ] ] ]

It says „followed immediately by a description and a tab character“ while the grammar suggests the
tab character and selector can be omitted together.

Haven't yet had a chance to check how it is in the code, but needs a documentation fix either way.

The impact of this difference can be seen using the following example. Consider the following gophermap line:

i'm blue

With the grammar not requiring a tab after the description, this would become an info line with the text 'm blue. If the tab was required however, it would become a info line with the text i'm blue.

@sternenseemann
Copy link
Author

After reading up on it, I believe the line should read:

        gophertypeDESCRIPTION\t   [ selector [ \thost [ \tport ] ] ]

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant