1

auto linking of key terms
 

For better integration, I want the user to be able to write say bug 12345 and automatically link to our bugzilla and other such use of key terms. What would be the best way to implement this? I am thinking, this should be generic enough that I can configure it in settings rather than patch Askbot locally.

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
mether's avatar
1.5k
mether
asked 13 years ago

Comments

see more comments

2 Answers

2

I will work on this!

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
sagarun's avatar
103
sagarun
answered 13 years ago
link

Comments

1

Super! we will merge your other commits today. Please try to make it possible to create a template for the autolinking from live settings.

Evgeny's avatar Evgeny (13 years ago)
1

Hi, I have added this feature in my auto-link branch https://github.com/sagarun/askbot-devel/commits/auto-link . Currently it processes only one regex and autolinks to an specified URL in settings UI. I am wondering about processing multiple regex's and URLS. Can i ask the user to specify the regex's and URLs in comma separated form in settings UI? Appreciate your suggestions :-)

sagarun's avatar sagarun (13 years ago)
1

@sagarun, looks great, I have a suggestion too - to support multiple patterns change the field to LongStringValue (or whichever allows multiline input) and then ask people to give one pattern/regex per line. And on save - validate the input:

  • numbers of lines must match in both fields
  • regexes should parse without errors

The live settings file supports input validation via an optional parameter update_callback, take a look at askbot/deps/livesettings/values.py to see how update callback is used... actually I am not 100% sure that proper custom validation can be done in livesettings.

Evgeny's avatar Evgeny (13 years ago)

@Evgeny Thank you! I will validate the user input. I will also look into LongStringValue

sagarun's avatar sagarun (13 years ago)
see more comments
1

In askbot/utils/markup.py LINK_PATTERNS can be modified. We've done it on a couple of instances.

To make it more user-friendly some settings could be added to askbot/conf/markup.py and hooked up in askbot/utils/markup.py.

Here is an example https://github.com/evgenyfadeev/askbot-devel/blob/17cd919b6d3dc125414625ed75c1c4f607e7a6ac/askbot/utils/markup.py

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
Evgeny's avatar
13.2k
Evgeny
answered 13 years ago
link

Comments

see more comments