Hi. Welcome to edev. Or perhaps you've been in edev for a while, but
you never really knew what to do with your %. Let me try to show you
the ropes just to get you started.
E2 is mostly written in Perl, but familiarity with web technologies
like HTML, SQL, CSS, XML, and javascript is of course desirable and
often necessary.
The edev nodelet
If you haven't done so already, go to nodelet settings and enable
the Everything Developer nodelet. It's got lots of nifty little things
that you'll need for finding your way around the code, which I'll now
describe briefly. The two most important things is that at the very
top of the nodelet you'll see a "viewcode" option on any node that
contains code. You'll also see a "using: $somepage" which refers to
the code that e2 is using to render whatever node you're currently
looking at. You'll be clicking on both of those buttons frequently in
order to look at the code.
-
Display types: This is at the very top of the nodelet.
In addition to the aforementioned viewcode button, most nodes
will also have an xmltrue button so that you can see what
XML e2 will generate for the current node, useful for e2 clients
or for Ajaxing.
-
Node Information: The next bit you'll see is useful
information about the node you're looking at, which in order is
the node id, the nodetype, and its creation time. The mantra
in e2 is everything is a node, writeups,
e2nodes, superdocs, nodetypes, you,
me, all nodes. The only big exceptions to things that are not
nodes but just entries in an SQL table somewhere are scratch
pads and messages.
-
Page using to display: Next up is a brief little line
that says "using: $somepage". That's the htmlpage that e2 is
currently using to display the node you're looking at. For
example, if you go to, say, Swap's Playground of type
superdoc, and you click on "viewcode", you'll see this bit
change from classic superdoc display page to superdoc
viewcode page, and you'll see whatever code I happen to have in
there at the time. If you ever want to change how e2 displays
superdocs or renders them when viewing the code, this will tell
you the htmlpage that you need to patch.
Those are the important bits. The rest of the nodelet has information
that will be less frequently used, which is why all of it can be
collapsed. Allow me to describe the next few bits of information that
you'll see in the nodelet.
-
CGIparam: Whenever you submit any kind of information to
e2, and this includes just telling it which node you want to
look at, you're submitting CGI variables, which will display
here. For example, if you are talking in the chatterbox,
you'll see the "message" CGI parameter showing up here with
whatever you said, along with related variables that e2 needs in
order to send your message. You will always be seeing at least
the node_id CGI parameter here, and sometimes it's useful for
other purposes to know exactly what information you're sending
to e2.
-
edev: Nothing terribly exciting, but whenever someone
clicks on that edevify! button in your epicentre, that document
will show up here.
-
Documents: Old and mostly obsolete documents. Also
contains as of this noding broken links to the Everything Bible.
Should probably fix this.
-
Util: Links to three mildly useful things. List Nodes
of Type can be useful, for example, if you ever want to know
what all the possible notifications are, or
perhaps all the achievements. Everything Data
Pages links to nodes that provide useful data that e2 clients
can use. The Everything Document Directory will bring you to
all the superdocs, or at least the ones you have permission to
look at (yeah, admins have sooper sekrit restricted_superdocs
that edevites cannot look at, not even their code).
-
Globals: There are a few global variables that are
always available. You can see their values here. Click on hashrefs
to expand them. They're "global" in the sense that they're
always available in every node, but most of them except
HTMLVARS are really local only to you.
-
Patches: Next you'll see a list vaguely reminiscent of
New Writeups that shows you which patches have been recently
provided and have not been applied. As soon as a patch is
applied, it vanishes from this list. You can always go to patch
manager to get the full list.
About that list bit, patches, let me go more into detail.
The patch system
Patching is one of the most important things that edevites can do.
Whenever you are looking at a node in viewcode mode, you'll have a
text box at the bottom of the node where you can see and modify the
code. Once you made whatever modification you deem appropriate and
you've written in the text field above it a brief description of what
you think your code should do, you can submit the patch for review by
a member of e2coders. Your patch will show up in this list in the
edev nodelet and in patch manager, with status "unknown" and
assigned to no one.
A remark about certain nodetypes whose display doesn't have nodelets,
such as the fullpage nodetype or the jscript nodetype. If you
stumble upon one of those nodes, you'll be faced with a display that
doesn't have the edev nodelet for you to click on "viewcode". Worry
not, you can still submit patches for those if you append in your browser's address bar
"&displaytype=viewcode" to the query string that shows that node.
You'll then be taken to the familiar display for every other node in
which you can submit patches.
About how patches work, as of this noding, it's still a bit primitive,
but hopefully it can be improved soon. A patch can be either be
applied or unapplied, and there are several statuses for being
unapplied, all of them currently woefully underused. When a member of
e2coders looks over your patch and thinks it's worthy, it will be
applied, and you'll be notified of this fact via /msg. Applying a
patch exchanges the contents of the patch with whatever node it's
patching, so once applied you'll see that the patch looks "reversed"
in its display mode. Almost surely, there will be a mistake in the
patch, and the same diligent e2coder will immediately unapply the
patch again in order to review the problem. While the patch is not in
an applied status, you can go and edit it with a little edit button
that you'll see at the top right of the patch and try to fix the
mistake, or perhaps the e2coder will do it for you. There will
probably be some consultation, some going back and forth, a few more
cycles of applying and unapplying the patch, and eventually if all
goes well, your fine work will become an enduring part of this site.
Well, that's the theory anyways.
That's it! That should be enough to get you started with the very
basics of coding for e2. If you want to learn more, start reading the
series by kthejoker and me of the same name.