I think this might be a problem with the theme I'm using (Nitobe). I'm also using the WYSIWYG rich text editor fckeditor.
When I make formatting changes to a post using fckeditor, such as bolding, italicizing, or more substantial changes, like adding a numbered list, it works fine. However, when I try to add line breaks, the changes are not reflected in the published version. I look at the html, and there's no <p> or <br /> tags there whatsover.
So, I might have some text that I edit like this in the editor:
"blah blah blah
foo foo foo"
When I save and view the node, it looks like this:
"blah blah blah
foo foo foo"
Then I go back to edit it again, and it looks like this:
"blah blah blah
foo foo foo"
Could it be that Nitobe and fckeditor are incompatible?
Solution: use an input filter without the line break converter.
Related
Is there a way to create my own abbreviations in atom and sublime like I can do with notepad++?
for example:
I have a chunk of code:
<!DOCTYPE html>
<html>
blah... blah... blah...
</html>
With notepad++, I can just use shortcut to wrap it with abbreviation (e.g.: html) and next time I can just type html and expand it, it'll pop out all the code. Instead of all the $>>>>** like in Sublime.
I've read a dozen of manual online for sublime and atom but honestly, I still don't get it.
Update:
Sublime > Tools > Developer > New Snippet...
<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html>
Blah blah blah
</html>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>html-blah</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>source.python</scope>
</snippet>
So after successfully saved the snippet, I type html-blah, there's no tab option.
The answer to your question (in the case of Sublime) is indeed Snippets as you've mentioned. They're a powerful way to include all sorts of text, including the ability to put placeholder fields that allow you to fill out more complex structures quickly and easily.
As outlined in your question the snippet you've defined will only have an effect in a Python source file because the scope is set to source.python.
Presuming that you want to use it to create a stub HTML document, you need to change the scope to text.html instead so that it will trigger from within HTML documents.
<snippet>
<content><![CDATA[
<!DOCTYPE html>
<html>
Blah blah blah
</html>
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>html-blah</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
<scope>text.html</scope>
</snippet>
You can determine the scope to use by placing the cursor in a file that you want to trigger the snippet in and selecting Tools > Developer > Show Scope Name from the menu. That command shows you the full scope of the character at the cursor, and the more of it you include in your scope the more dialed in your snippet becomes.
For example, a scope of text works in all text files, text.html works in HTML based files like HTML and Markdown, and text.html.basic only works in HTML files but not Markdown (which are text.html.markdown).
Something to keep in mind is that the scope is based on the syntax that is set for the file, and by default all new tabs in Sublime are created using the syntax for Plain Text, so before the snippet will trigger you need to assign the appropriate syntax.
You can do that by:
Saving the file with an appropriate extension
Selecting the appropriate syntax from View > Syntax in the menu or by clicking on the type of the current file in the bottom right of the window (both open the same menu)
Selecting the appropriate Set Syntax: command from the Command Palette.
For more information on the power of snippets I recommend the Unofficial Documentation, which includes a section on Snippets.
Note that there is already an existing snippet that ships with Sublime named html that does something similar to your example already.
In sublime you need to install the Emmet package. It is easyer done by using the Package control. There are instructions on how to install it in the github repo: https://github.com/sergeche/emmet-sublime#available-actions
Sorry for mistaking your issue with snippets :)
I'm trying to use InDesign to revamp a scientific magazine published by my course in college. Until now, everything was done by hand using Microsoft Word.
The problem that stumped me is this: I need to show, in every chapter's footer, a line of text like this:
Tríade - Sorocaba, v. <issue number>, ed. <edition number>, <chapter title>, <number of the page the chapter started>-<number of the page the chapter ends> -- <month>/<year>.
So, in Chapter One, titled "Hello World", spanning from page 10 to page 15, the footer would like this:
Tríade - Sorocaba, v. I, ed. II, Hello World, 10-15 -- April/2017.
In Chapter Two, titled "It's me", pages 16-25, the footer would change to this:
Tríade - Sorocaba, v. I, ed. II, It's me, 16-25 -- April/2017.
As I've said, in the last issues, we did everything by hand, editing everything, but InDesign should make everything a lot smoother, except I can't find a way to make this footer to work. I scoured the manual, but there is only the "last page" variable, that shows number of pages from the entire document. There is no set variable that shows the first and last page numbers from each chapter. How can I do this in InDesign?
Last page variable:
Text > Variable > Define > Modify "Last page"
Select "Section" as range instead of document.
First page of section:
a little bit trickier:
Create a hyperlink text destination on the first page of the
section, then cross-reference it in your
Master page footer, which can be set to show only the page number.
I realize that normally when you describe some code (in a GitBook or anywhere else):
var foo = bar();
you don't want to add links to it. However, for some documentation I'm writing it would be really great if I could somehow add a link inside the code:
var foo = bar(); // "bar" links to a page describing bar
Is there any way to achieve this, possibly using a GitBook plug-in, HTML instead of Markdown, or some other inconvenient technique?
I found a "poor man's" solution to the problem, but if there are any better ones I'd love to hear them.
Essentially Markdown just converts indented code in to:
<pre><code>*the code*</code></pre>
Inside a <code> tag <a> tags (links) won't work, but they do work inside a <pre>, and a <pre> by itself almost looks like code block. Of course you don't get the syntax coloring with this approach, but at least it does offer a way to add links to code examples.
i'd like to find a way to call [[*content]] of every page in one template. I mean something still dynamic so that I could add or remove pages and it would appear in the menu without modifying anything.
http://fr.wix.com/website-template/view/html/tokyo-design
I want to use this kind of navigation with modx. Maybe getresource is the answer but I need to display something like this:
<div>[[*contentpage1]]</div>
<div>[[*contentpage2]</div>
<div>[[*contentpage3]]</div>
...
Could someone help me with this?
Thank you
Sounds like you are on the right track, using GetResources should be able to do this for you:
"
[[!getResources:default=``? &parents=`0` &includeContent=`1` &tpl=`contentoutput`]]
"
Then create a new chunk called "contentoutput" which contains the code you want to output, e.g.
"
<div>
[[+content]]
</div>
"
Given the following HTML code (which, I realise, sucks, but that's not something I can currently solve):
<img height="64" width="64" class='list_item' src="/img/icon/first.jpg"
title="This is the first item::Completed the item "I did this first"" alt="First" />
gives me a result of (this is an image.to_s)
name:
type:
id:
value:
disabled:
src: /img/icon/first.jpg
width: 64
height: 64
alt: First
Note lack of "title" element. This does not actually change (the lack of the title element)
If I get the contents of the parent div of one of those icons, I get something like:
<img class="list_item" I="" did="" this="" first="" src="/img/icon/first.jpg" alt="First">
The broken HTML of the original has been turned into separate attributes somewhere down the line, but the title tag appears to have been stripped completely, and since it's the contents of the title tag I need, I'm a little stuck.
This has been tried with lastest Watir on Ruby 1.9.2 using Firefox.
Perfect world solution: I'd like to get the original transmitted HTML for the image tag, so I can "special case" (ie, hack) around the stupid double-quote problem.
Good Enough Solution: the contents of the title tag.
There is actually a #title method on Watir::Image. With the above incorrect HTML the output would be like this (where 'i' is the Image object):
i.title
=> "This is the first item::Completed the item "
This shows only part of the title.
But you could use #html and then parse all the necessary information out of it with some magic:
i.html
=> "<IMG class=list_item title=\"This is the first item::Completed the item \" alt=First src=\"/img/icon/first.jpg\" width=64 height=64 first?? this did I>"
But as other answers above have mentioned - you cannot get it out correctly due to the bad HTML. Maybe there's some other way to accomplish your bigger goal you're having?
getting the title probably isn't working because the way the title attribute is set on that element isn't valid. entities " and < and > need to be escaped inside html attributes, with " and < and > respectively. Escape the quotes and try again.
Not sure, but I don't think Watir supports image titles. I looked over the Supported Elements page, title was x'ed out. I don't see it in the RDoc for Watir::Image type either.