Links to documents can easily be created by either outputting...
in your snippet, where $documentId is the ID of the page, OR you can create a links using the function makeUrl, as in...
$documentLink= $modx->makeUrl($documentId)
You can also specify an $alias as a second parameter (though this isn’t really necessary or useful it seems), and the query string to append as the third parameter, e.g.
$documentLink= $modx->makeUrl($documentId, '', '?param1=value1¶m2=value2')
Re: weblogin, yes the weblogin snippet demonstrates how to login and logout to the MODx site as a web user, including creating a logout link, if the user is already logged in. You won’t be calling the snippet, I don’t think, unless you want a login form to appear if they aren’t logged in, versus the logout link. In this case, take a look at what we did in the default site content, to present a document called login OR logout (depending on the user state) in the menu and using a placeholder assigned by a TV with an @EVAL script to title the document.
For what it is worth, future versions will have a better user/authentication API so you can more easily create custom logout links, etc.