Recent Posts

Subscribe to Recent Posts 325 posts found

posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Feature Requests

Actually, I’m going the other way. I’m going from LaTeX to Instiki. So the source file has \label{foo} and \ref{foo} in it already and in the LaTeX output then it gets converted to “In (2) we saw that …”. So there’s nothing in the source to put as the text in the anchor and something has to be put in its place. Thus my thinking was to subvert the maruku counter-counting to figure out what text should go there. Putting a class .num_enuma on each element of the list makes maruku think that there is a list to be counted there and so it converts the \ref{foo} to the correct hyperlinked text. If you’re using maruku here, this should work:

  1. The first item.

  2. The second item.

Now we should be able to refer to 1 and 2. I won’t know if that worked until I save the reply, though!

Anyway, it certainly does work on Instiki. I don’t need another list in the CSS because the counters are already produced by the browser working on the list. All I need is for maruku to count the entries in the list, and for that I just need the dummy num_X classes. You’re right that I need one per list, but that shouldn’t be that many on any given page.

(Okay, time to see if that list worked.)

 
posted 2 years ago
distler 77 posts

Forum: Instiki – Topic: Feature Requests

I’m not sure I understand. If an element has an explicit id, because you gave it a {: #foo} IAL, then you can refer to it a [fubar](#foo). \ref{...} is used for linking to things with generated numbers (like theorems, ‘n such).

I think your motivation is to have something that converts to LaTeX. \ref{foo} converts just fine. There are two issues, if I understand correctly.

  1. The IAL on the list-item doesn’t get converted to a \label{foo} on the \item in the LaTeX output.
  2. For the XHTML output to behave as you would like, you need to invoke Maruku’s internal counter, so that \ref{foo} is converted to a hyperlink, with anchor-text being the number of the list-item.

The latter is a bit awkward, as there can be several ordered-lists on a page. We’d need a separate counter for each one, no?

 
posted 2 years ago
distler 77 posts

edited 2 years ago

Forum: Heterotic Beast – Topic: Feature Requests

With the anonymous posting, then I can specify it on a “per category” basis in Vanilla. The hierarchy in Vanilla is:

Forum: Category: [Subcategory:...] Discussion: Post

I think this maps onto

Site: Forum: Topic: Post

with the proviso that (at least as currently implemented) “Sites” need to live on separate subdomains.

So you’re talking about allowing anonymous postings on a per-forum basis?

To avoid spam, the person has to solve a reCaptcha to post.

There’s some captcha mechanism built-in (but disabled) in Beast. Will have to explore …

Behind the scenes, there is a “guest” user and the software logs in the guest user, posts the post, and then logs out again. All such posts get authored by “Guest” and (this is less than ideal) …

I suppose just creating a “Guest” user, with a blank password, would not suffice, as “Guest” could then post to any forum.

Regarding “editable” posts, I’d go for “created_at”. A discussion is a linear thing, and most of the time edits will be for minor typos which certainly shouldn’t change the order. Deciding on the difference between minor and major is a human thing.

If you wanted the best of both worlds, an edit to a post could insert a line at the relevant time point saying “Post X was edited at …”. That wouldn’t disrupt the flow of the conversation but would signal that someone had potentially thrown a stone in to the water.

Or simply tag the post, itself, as having been “Edited at …”

Maybe best of all would be a 5-minute grace period: if updated_at time - created_at time > 5 minutes, then include such a tag.

… Like on this post.

 
posted 2 years ago
distler 77 posts

Forum: Instiki – Topic: Bugs

Ah, that’s unfortunate. What other markdown engines are available for Ruby?

There are several.

  1. There’s rdiscount, based on discount.
  2. There’s BlueCloth, which was the “original” Markdown interpreter for Ruby, which sucked bigtime. But Bluecloth 2.x has been rewritten to use discount.
  3. There’s rpeg-markdown, based on peg-markdown.

The latter is probably the most promising. One “just” needs to write a PEG grammar for Maruku’s extended Markdown syntax, and then drop it in as a replacement.

“Just”

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Feature Requests

Just tested adding IALs to lists. Definitely useful, but I’d add one minor modification: the ability to use \ref to refer back to list elements (at the very least, to enumerated list elements). So

1. {: #first} The first item

The first item was \ref{first}

would work. At the moment, I have a hack that uses the numbering system for theorems and so forth to get this to work, putting the class .num_enumX (X increments with the enumerate environment so that each is unique) on a +-- ... =-- div at the top of the list element. This seems to be enough to trigger the internal maruku counter and so make \ref{...} work. It’d be great if this were done automatically without that hack.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Heterotic Beast – Topic: Feature Requests

With the anonymous posting, then I can specify it on a “per category” basis in Vanilla. The hierarchy in Vanilla is:

Forum: Category: [Subcategory:...] Discussion: Post

Subcategories aren’t really hierarchical in the code, just in the layout. So “per category” doesn’t descend to categories (unless I’m misremembering … I did code this part so I ought to know!). On the nForum, then the allowed category is “nLab - Latest Changes”. To avoid spam, the person has to solve a reCaptcha to post. Behind the scenes, there is a “guest” user and the software logs in the guest user, posts the post, and then logs out again. All such posts get authored by “Guest” and (this is less than ideal) there’s no obvious “Put your name here” field (one has to put it in the post itself). Nonetheless, it works reasonably well and means that people can leave short messages about nLab pages without having to sign up.

Regarding the roles, I’d want something in between moderator and user. On the nForum, then some users have slightly more “power” with regard to organising the place. They don’t have full moderator power, so can’t edit others’ posts and so forth, but they can move posts from one category to another, or similar simple things.

Regarding “editable” posts, I’d go for “created_at”. A discussion is a linear thing, and most of the time edits will be for minor typos which certainly shouldn’t change the order. Deciding on the difference between minor and major is a human thing.

If you wanted the best of both worlds, an edit to a post could insert a line at the relevant time point saying “Post X was edited at …”. That wouldn’t disrupt the flow of the conversation but would signal that someone had potentially thrown a stone in to the water.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

Incidentally, I got around my immediate indentation problem, so you can consider that one downgraded!

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

Ah, that’s unfortunate. What other markdown engines are available for Ruby?

If you’re actively looking, I could run some searches on the nLab pages to see what syntax is used and what isn’t.

I do think that the attribute stuff is a brilliant addition; it makes it possible to make the pages a little more easily customised.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Feature Requests

Ah, number 2 is fantastic. I hadn’t spotted that (I’ve been particularly bad at monitoring the RSS feeds since my feed reader blew up). I’ll try that.

 
posted 2 years ago
distler 77 posts

Forum: Heterotic Beast – Topic: Feature Requests

Andrew Stacey wants:

  • The ability to selectively allow anonymous posts (ie, posts by unregistered users). It’s not clear whether he wants that on a per-forum basis, or on a per-topic basis. It’s also not clear who gets to decide (moderator or admin).
  • Themes. I think themes_for_rails looks promising.
  • More fine-grained access-controls. Apparently, admin/moderator/user(/anon) is insufficiently fine-grained.

Other thing that bear looking at:

  • The Signup process.
  • Since posts are editable, should they be ordered by updated_at instead of by created_at dates?
 
posted 2 years ago
admin 57 posts

Forum: Heterotic Beast – Topic: Bugs

Let’s discuss bugs in Heterotic Beast.

 
posted 2 years ago
distler 77 posts

edited 2 years ago

Forum: Instiki – Topic: Bugs

Both this request (for “fenced” quotations and lists) and this one, in the other thread, are for extensions to the Markdown syntax in Maruku.

Frankly, I’m very reluctant to spend any time working on Maruku.

The author (who is no longer actively developing the software) insists on a GPL license, which conflicts with the licenses for both Instiki (Ruby) and Heterotic Beast (MIT). Unless he changes his mind (which seems unlikely, as I’ve asked several times), I would prefer to ditch Maruku, in favour of another Markdown engine.

Consequently, I’d rather spend my time extending that engine (whatever it turns out to be). Of course, for the present, I am still going to fix bugs in Maruku.

Update:

Well, OK, I didn’t exactly keep that promise…

 
posted 2 years ago
admin 57 posts

edited 2 years ago

Forum: Instiki – Topic: Feature Requests

Hmmm.

  1. I agree that *this*{: style="font-style: normal; color: red;"} is a little silly.
  2. I thought you could already do that (see here). (It seems that you need a space between the ”2.” and the IAL, despite what I said there. I think this is a result of this commit.)
  3. I’m not sure I understand your Javascript suggestion. Could you point to some software that implements something similar?
 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Feature Requests

Here’s another random idea: to make it easier for people to contribute to a wiki (thinking particularly of the nLab), howabout a javascript annotation system? Some people might find it a bit daunting to edit a whole page just to correct a minor spelling mistake, but could leave a quick note so that the next person who does edit the page can see what outstanding notes there are.

Just a random idea - I haven’t thought it through very much. (But I did a little search to see that it was, at least, technically possible via javascript.)

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

To be honest, I find the whole indentation system for preserving environments a nightmare! Particularly, with regard to cut-and-pasting. It’d be great if there were alternatives available, like there is for code blocks.

(I’m right about that, aren’t I: the “fences” from PHP Markdown Extra work in maruku, don’t they? Let’s try:

some code

I’ll find out when I hit “save reply”! Incidentally, I think that a preview makes a little more sense on a forum than on a wiki.)

Maybe:

>>>
a quote
>>>

for quotes, and

123
1. For lists.
123

With the assumption that everything between one M. and another N. (M,N) is in a single list item.

Can’t think of anything else that relies on indentation.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Feature Requests

(I’m really just trying out the features of the forum, but may as well do so in a “useful” way.)

  1. I’d like a span equivalent of the +-- {: .class attributes} ... =-- syntax. At the moment, I do something like *word*{: style="text: normal"} which seems a bit daft.

  2. I’d like an easy way to add id (and other attributes) to individual list elements. So I could write 1.{: #firstitem} to get an id tag on that item.

That’s all for now!

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Feature Requests

This is a thread for feature requests for Instiki.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

Yes, that worked. Because I modified the indentation a little, the theorem no longer got noticed. All-in-all, I find the indentation rules to be a little too strict! As can be seen, indenting one space extra made no difference between the second and third lines, but caused the fourth line to not be seen as a theorem.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

That didn’t, show what I wanted to show so let me try again.

  1. This is a list.

    This is in the same item, indented to ensure that.

    This is also in the same item, indented one step more.

    ###### Theorem ###### This is an amazing theorem.

  2. Another list item.

 
posted 2 years ago
admin 57 posts

Forum: Instiki – Topic: Bugs

Right, I now appear to be logged in again.

The second, “mystery” user is a bit of a … mystery. Clearly, there are many parts of the code which work in inscrutable ways.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

Right, I now appear to be logged in again.

What I was trying to demonstrate in the above was that I don’t always get the indentation right with maths in lists I’ll have to think again to get an example that demonstrates it, though.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Bugs

Let’s see if this shows up here on the forum. It’s to do with newlines and lists.

  1. This is a list. I want to put some maths in it, so I merrily go ahead and do so.

    [a b c d]\begin{bmatrix} a & b \\ c & d \end{bmatrix}
  2. This is the next item in the list.

Let’s see if the above shows what I want it to show.

 
posted 2 years ago
Andrew Stacey 118 posts

Forum: Instiki – Topic: Shiny new forum

Looking pretty impressive so far, I must say. Not sure that “save reply” is the best text, it’s not clear whether or not it will actually post the reply or not. Still, only one way to find out.


It posted it. Now I know!

 
posted almost 3 years ago
admin 57 posts

Forum: Instiki – Topic: Bugs

Let’s discuss bugs in Instiki.

 
posted almost 3 years ago
distler 77 posts

edited 3 months ago

Forum: Instiki – Topic: Shiny new forum

We can type equations

(1)(a b c d)(x y)=0 \fghighlight{red}{\begin{pmatrix}a&b \\ c&d\end{pmatrix}} \begin{pmatrix}x\\ y\end{pmatrix}=0

or put them in SVG graphics

Layer 1 ( a b c d ) ( x y ) = 0 \begin{pmatrix}a&b \ c&d\end{pmatrix} \begin{pmatrix}x\ y\end{pmatrix}=0

or type some code

require 'chunks/chunk'

# Contains all the methods for finding and replacing wiki links.
module WikiChunk
  include Chunk

  # A wiki reference is the top-level class for anything that refers to
  # another wiki page.
  class WikiReference < Chunk::Abstract
	
    # Name of the referenced page
    attr_reader :page_name

    # Name of the referenced page
    attr_reader :web_name

    # the referenced page
    def refpage
      @content.web.page(@page_name)
    end
	
end

and so forth.

Theorem

(Distler’s Theorem). Any given programming task is easier with Rails.