New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Language page categories #2369
Merged
Merged
Language page categories #2369
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
=begin pod | ||
|
||
=TITLE Brief Introduction | ||
|
||
=SUBTITLE Using the Perl6 Documentation | ||
|
||
Documenting a large language like Perl6 has to balance several contradictory goals, such as being brief | ||
whilst being comprehensive, catering to professional developers with wide experience whilst also being accessible to | ||
newcomers to the language. | ||
|
||
For a quick hands-on introduction, there is a short L<C<annotated programming example>|/language/101-basics>. | ||
|
||
For programmers with experience in other languages, there are a number of B<Migration> guides that compare and | ||
contrast the features of Perl6 with other languages. | ||
|
||
A number of B<Tutorials> cover several areas in which Perl6 is particularly innovative. The section headers should help navigate | ||
the remaining documents. | ||
|
||
There are a number of L<C<useful resources>|https://perl6.org/resources> listed elsewhere on the perl6.org site. | ||
These include articles, books, slide presentations, and videos. | ||
|
||
It has been found that newcommers to Perl6 often ask questions that indicate assumptions carried over from other | ||
programming paradigms. It is suggested that the following sections in the FUNDAMENTAL TOPICS section | ||
should be reviewed first. | ||
|
||
=item L<C<Signatures>|/type/Signature> - each routine, which includes subroutines and methods, has a signature. | ||
Understanding the information given in the signature of a C<sub> or C<method> provides a quick way to | ||
grasp the operation and effect of the routine. | ||
|
||
=item L<C<Containers>|/language/containers> - variables, which are like the nouns of a computer language, are | ||
containers in which information is stored. The first letter in the formal | ||
name of a container, such as the '$' of $my-variable, or '@' of @an-array-of-things, or '%' of %the-scores-in-the-competition, | ||
conveys information about the container. However, Perl6 is more abstract than other languages about what can be stored | ||
in a container. So, for example, a $scaler container can contain an object that is in fact an array. | ||
|
||
=item L<C<Classes and Roles>|/language/classtut> - Perl6 is fundamentally based on objects, which are described | ||
in terms of classes and roles. Perl6, unlike some languages, does not | ||
B<impose> object-oriented programming practices, and useful programs can be written as if Perl6 was purely procedural in | ||
nature. However, complex software, such as the Perl6 compiler itself, is made much simpler by writing in object-oriented idioms, | ||
which is why the Perl6 documentation is more easily understood by reviewing what a class is and what a role is. Without understanding | ||
about Classes and Roles, it would be difficult to understand Types, to which a whole section of the documentation is devoted. | ||
|
||
=item L<C<Traps to Avoid>|/language/traps> - Several common assumptions lead to code that does not work | ||
as the programmer intended. This section identifies some. It is worth reviewing when something doesn't quite work out. | ||
|
||
=end pod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,13 +30,14 @@ constant $TITLE = '=TITLE'; | |
constant $SUBTITLE = '=SUBTITLE'; | ||
constant $NBSPACE = "\x[A0]"; | ||
|
||
my $usage = "Usage: $*PROGRAM-NAME update | control [--debug --help]"; | ||
my $usage = "Usage: $*PROGRAM-NAME update [--manage ] | control [--debug --help]"; | ||
sub USAGE { say $usage } | ||
my %*SUB-MAIN-OPTS = named-anywhere => 1; | ||
unit sub MAIN( | ||
$mode = '', | ||
Bool :d(:$debug) = False, | ||
Bool :h(:$help) = False, | ||
Bool :m(:$manage) = False, | ||
# special options for control: | ||
Bool :r(:$refresh) = False, | ||
Bool :n(:$new) = False, | ||
|
@@ -51,11 +52,13 @@ given $mode { | |
do-control(); | ||
} | ||
when /^u/ { | ||
=begin comment | ||
EXIT("Options 'refresh' and 'new' are not used with 'update'.") | ||
if ($new || $refresh); | ||
=end comment | ||
do-update(); | ||
if $manage { | ||
do-update() | ||
} else { | ||
copy-dir-tree :fromdir('doc'), :todir('build') | ||
}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No need for the semicolon here. |
||
} | ||
default { | ||
EXIT("\$mode '$mode' is unknown"); | ||
|
@@ -67,23 +70,20 @@ sub do-update () { | |
|
||
# FIRST | ||
# write the auto-generated pod6 files used for the Language page | ||
=begin comment | ||
|
||
# visit later | ||
write-Language-files(); | ||
=end comment | ||
|
||
# THEN | ||
# copy all under the doc dir to the build dir | ||
# NOTE this assumes the sort order is alpha by file name | ||
# NOTE we exclude the Language dir | ||
=begin comment | ||
# visit later | ||
copy-dir-tree(:fromdir('doc'), :todir('build'), :exclude('Language')); | ||
=end comment | ||
copy-dir-tree :fromdir('doc'), :todir('build'); | ||
#copy-dir-tree :fromdir('doc'), :todir('build'); | ||
} | ||
|
||
sub copy-dir-tree(:$fromdir, :$todir, :$exclude) { | ||
sub copy-dir-tree(:$fromdir, :$todir, :$exclude = '' ) { | ||
# recursively copy tree to another tree | ||
return if !$fromdir.IO.d; | ||
|
||
|
@@ -142,7 +142,7 @@ sub write-Language-files() { | |
next if $line !~~ /\S/; | ||
|
||
# line may be a group line or a pod6 data line | ||
if $line ~~ /:i ^ \h* 'group:' (.*) / { | ||
if $line ~~ /:i ^ \h* 'section:' (.*) / { | ||
# a new group | ||
my $group-char = shift @a; | ||
|
||
|
@@ -188,7 +188,7 @@ sub write-Language-files() { | |
else { | ||
#$fh.say: "$line :page-order<{$page-order}>"; | ||
$fh.say: "# THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST"; | ||
$fh.say: $line; | ||
$fh.say: $line ~ " :link<$key-fname>"; | ||
#$fh.say: "=comment THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST"; | ||
} | ||
next; | ||
|
@@ -450,6 +450,7 @@ sub help { | |
-n - create (for mode 'control') | ||
-h - extended help | ||
-d - debug | ||
-m - manage (include the categories) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is not aligned vertically with the rest of the lines |
||
|
||
Note: The modes are selected by entering either the first letter | ||
of the mode name or its complete name. | ||
|
@@ -472,7 +473,7 @@ sub write-group-page($group-char, $title, $page-order) { | |
# note no SUBTITLE | ||
$fh.print: qq:to/HERE/; | ||
# THIS FILE IS AUTO-GENERATED--ALL EDITS WILL BE LOST | ||
=begin pod | ||
=begin pod :class<section-start> | ||
=TITLE $title | ||
=SUBTITLE ~ | ||
=end pod | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This whole document says “Perl6” when I think we settled on “Perl 6” with no-breaking space. Maybe it is worth changing it, although with recent discussions regarding an alias it may be worth to reword some sentences so that the language name is not spelled out. @JJ what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That can be fixed when approved, no big deal.