Repository
https://github.com/irelandscape/quearn
Pull Request
https://github.com/irelandscape/quearn/pull/20
New Features
Many people are still reading StemQ posts using other Steem apps such as Steempeak or Steemstem.io.
One point that has been raised on several occasions is that, when reading an answer post, it would be nice to have a link to the original question post.
The StemQ UI facilitates this by presenting a button redirecting the user the original question page.
However other Steem applications are not aware of the relationship between questions and answers and therefore do not offer this facility.
The first feature added by this PR is the insertion of a link to the original question in the answer post.
The second feature that has been added with this PR is the capability for the administrator to configure a list of default tags to be suggested to the user when submitting a new post.
Some people have been confused on whether or not they should specify the #steemstem tag on their StemQ posts and this feature is now used to automatically suggest the #steemstem tag. This tag can be removed by the user if so desired.
StemQ automatic insertion of link to question within answer post
A new feature has been added to StemQ whereby any answer submitted on stemq.io will have a text notice inserted at the beginning of the post along with a link to the question post.
The notice and the link, while visible on other Steem apps, is automatically removed from the post body when viewing the answer using the StemQ UI.
The code changes extend on the existing feature whereby another StemQ notice is already added at the end of all posts to let people know that an article has been posted through stemq.io
How was this feature implemented?
Quearn now maintains an array of regular expressions to look for in post bodies. Any string matching these regular expressions is automatically removed from the main text before being rendered on the screen.
A single regular expression is currently inserted into this array when the application start.
This is shown in the code snippet below (this code belongs to the Quearn Quasar plugin code which is invoked at startup):
axios.get(store.getters['quearn/serverURL'] + '/configs/').then(
function (response) {
let config = response.data[0]
store.commit('quearn/config', config)
// document.title = config.appName
store.commit('quearn/removePatterns', new RegExp('\\*\\*' + config.appName + ' [Nn]otice:.*\n*', 'g'))
}).catch(
function (error) {
console.log(error)
Notify.create('Failed to contact API Server')
})
So, as can be seen from the above, the regular expression will match any line matching "**<application name> [Nn]otice:" following by empty lines.
For StemQ, this means that all lines matching "StemQ [Nn]otice:" will be removed.
The link to the question is evaluated by the following code:
The code above does two things.
It prepends a StemQ notice at the start of the body, using the i18n translation of the "linktoquestion" text.
It evaluates the URL to the question and substitute the @LINK string with this URL in the notice.
Finally, the code generating HTML from markdown had to be updated to remove all text matching the regular expressions previously mentioned:
Default tags
This feature the administrator to configure a comma separated list of tags which will be automatically offered to the user upon submitting a new post on StemQ.
StemQ uses this feature to offer the #steemstem tag. The user is free to remove this default tag.
How was this feature implemented?
First, a "default_tags" was added to the quearn-server backend Django application.
The ediblog.js script which manages the post submission form has been updated to split this comma separated list and present the corresponding tags in the QChipsInput form field:
Looks great @irelandscape!
The reference link to the original stemq interface is a great touch.
Tag picker accepts weird tags. Might be good to filter/validate them.
On a minor note;
Looks like we have some leftovers from the template. :-)
Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.
To view those questions and the relevant answers related to your post, click here.
Chat with us on Discord.
[utopian-moderator]Need help? Write a ticket on https://support.utopian.io/.
Thanks for pointing the issue with the weird tags. I'll fix this shortly.
Also, I corrected the github account url.
Thank you for your review!
Thank you for your review, @emrebeyler! Keep up the good work!
This is indeed a necessary feature :) Thank you @irelandscape for implementing it. @rycharde : Are you happy now?
Hi, hope this will be good for StemQ :-) It isn't that anybody willfully ignores the StemQ website, but rather that posts appear across platforms - now users can be directed to the source and context.
Thanks for your feedback guys!
Hi @irelandscape!
Feel free to join our @steem-ua Discord serverYour post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation! Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Hi, @irelandscape!
You just got a 1.92% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.
Congratulations! Your post has been selected as a daily Steemit truffle! It is listed on rank 25 of all contributions awarded today. You can find the TOP DAILY TRUFFLE PICKS HERE.
I upvoted your contribution because to my mind your post is at least 5 SBD worth and should receive 154 votes. It's now up to the lovely Steemit community to make this come true.
I am
TrufflePig
, an Artificial Intelligence Bot that helps minnows and content curators using Machine Learning. If you are curious how I select content, you can find an explanation here!Have a nice day and sincerely yours,

TrufflePig