How do I define a site ?

Asked by Alexandre René

I'm trying edit the site list in nXhtml (rather, to add one item so the list isn't empty). However, I can't seem to quite get the format correctly and I get find any resource explaining how to get this done. So if you can explain how it is *supposed* to be done, that would be great. Also, if it doesn't involve directly editting .emacs, please show how the relevant lines in .emacs should appear.

Here's what I've tried to date :
Read the comments and some of the code in html-site.el, html-toc.el, html-wtoc.el
As indicated in html-toc.el, I added (require 'html-toc) to my .emacs (I don't need the TOC functionality, but the site list seems to require a TOC pages file which is created with this function)
Added (require 'html-site) to .emacs as otherwise the contained functions were not loaded

Result :
Clicking the menu item "Edit Sites" says my setting is "SAVED and set. (mismatch)". In other words, the list is incorrectly formatted.
I thought this might be caused because I had no TOC page file. So I tried "M-x html-toc-create-pages-file" which returns "No current site set"
And of course, clicking the menu item "Set Current Site" says "Wrong type argument: stringp, (my site-list item)". So, again, the list format seems incorrect.

I think the solution is simple, is just that the site feature isn't really documented anywhere (at least anywhere I could find).

Question information

Language:
English Edit question
Status:
Solved
For:
nXhtml Edit question
Assignee:
No assignee Edit question
Solved by:
Alexandre René
Solved:
Last query:
Last reply:
Revision history for this message
lborgman (lennart-borgman) said :
#1

Hi Alexandre, this is a good question.

The answer is fortunately simple:

- Add new sites through the custom interface. Just use the menu item under "nXhtml - Sites - Edit sites".

The bad thing is that it does not work at the momen ;-(

What you need to do is to load html-site first: (require 'html-site).

Can you please just restart Emacs and try that?

Revision history for this message
Alexandre René (waterfront) said :
#2

Yes I had gone through the custom interface. Is I indicated, at some point I noticed that html-site wasn't loaded, so I added (require 'html-site) to .emacs. This solved one problem, but I'm still not perfectly clear as to what each element of the site list should be (and clearly what I'm doing is incorrect). After your reply, since you mentioned loading it first, I tried putting that line before (require 'html-toc), but as expected that didn't change anything

Some slight progress :
Once, and only once among all my attempts, the interface showed a line for each site element (Site name, root directory, etc.) rather than one blank line for the whole list. I filled it out, seemed to get at least one format error, then when I reloaded emacs it was gone (I was back to a single line). It turns out this error was caused by the invalid site list. Deleting it fully from the interface didn't work, so I had to comment it out directly in .emacs. Now I seem to get the correct interface.
Could you post an example of what should be entered in the fields ? What fields are optional ? For the majority, it's pretty clear, but some of them aren't obvious as to what exactly is required or how it should be formated (with or without quotes, for example)

Revision history for this message
lborgman (lennart-borgman) said :
#3

It is html-site you should load, not html-toc. (It is a bug that you have to do that now. I will fix it soon in the repository for nXhtml. And it was a bug that html-toc said you should add it to your .emacs.)

How do you load nXhtml?

Revision history for this message
Alexandre René (waterfront) said :
#4

Ok, so I removed (require 'html-toc) from .emacs; the relevant lines now look like this :

;;nXhtml
(load "~/.emacs.d/nxhtml/autostart.el")
(require 'html-site)

With the working custom interface, I tried defining a site list with only the following variables:
Site name
Site root directory
Ftp host address
Ftp user
Ftp password
Ftp directory root

and now it seems valid. So it seems whatever I was putting as the Web host address or Web directory root was making it balk. Now I've got basic functionality working, although it seems some of the ftp settings need some tinkering because my first attempt at uploading didn't work well. So my main problem is solved. I still have a couple questions though :
- What exactly is expected for the three last options (Web host address, Web directory root, Web directory root for pages with TOC) ?
- What is the effect of the different variables related to TOC and frames, and how is the resulting site built.

Finally, I have only one actual problem left. My site definiton works, and I can correctly search for files on my site. However, the available files are only those that are "0 or 1 level down". In other words, if my root directory is "~/site", then the files "~/site/index.html" and "~/site/en/welcome.html" are considered part of the site, but "~/site/files/images/welcome.gif" is not. Is there a way for sites to include files of an arbitrary depth ?

Note : Although I can't yet access the full possibilities of the site feature, my basic problem is solved, so I'm marking the issue as such.

Revision history for this message
lborgman (lennart-borgman) said :
#5

Hi again Alexandre, yes at the moment you need that (require 'html-site).

What made it balk was probably the elisp structure. It is quite hard to get it right without using the custom interface.

The last three parts of a site are for displaying the site in a web browser. I have for example those

            Web host address: OurComments.org
            Web directory root: /Emacs/nXhtml/tut/
            Web directory root for pages with TOC:

(I do not use the TOC capabilities any more myself.)

My intention was to explain this in the documentation for html-site-list, but I can see now I have not finished that. I thought before that I should rewrite this using the new project facilities of Emacs, but I have not had time (and those things have not yet stabilized in Emacs, ECB is not yet in Emacs). It is quite a bit of work and I would welcome if anyone wanted to work on it.

-----------
I can not reproduce the problem with the levels. Can you please tell me exactly what you do?

Revision history for this message
fdsdgsdgds (fgfdfgdfsdf) said :
#6

Hello, i've got a problem with defining a site, too. I tried to do it through the customization interface and by editing my ~/.emacs.d/init.el. I checked my ~/emacs.d/nxhtml/autostart.el for requiring html-site – it's in place. Emacs didn't report any errors, all seems to be ok. I can't even see my site's directory listing. That's a part ofmy init.el, created by customizer:

(custom-set-variables
  ;; custom-set-variables was added by Custom.
  ;; If you edit it by hand, you could mess it up, so be careful.
  ;; Your init file should contain only one such instance.
  ;; If there is more than one, they won't work right.
 '(html-site-current "myhost")
 '(html-site-list (quote (("myhost" "/home/user12345/" "" "" "" "" "" nil "user12345.ftp.myhost.com" "user12345" "mypass" "/" "" "" "" "")))))

If i connect to server via FTP, i see my home directory first. Is it compliant folder for “FTP directory root” property?

Revision history for this message
fdsdgsdgds (fgfdfgdfsdf) said :
#7

Ooops, i forgot to describe my system:
Gentoo linux x86_64, emacs 23.2.1, nxhtml 2.08