summaryrefslogtreecommitdiffstats
path: root/kate/scripts
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commit84da08d7b7fcda12c85caeb5a10b4903770a6f69 (patch)
tree2a6aea76f2dfffb4cc04bb907c4725af94f70e72 /kate/scripts
downloadtdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.tar.gz
tdeaddons-84da08d7b7fcda12c85caeb5a10b4903770a6f69.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaddons@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kate/scripts')
-rw-r--r--kate/scripts/Makefile.am2
-rw-r--r--kate/scripts/html-tidy.desktop77
-rw-r--r--kate/scripts/html-tidy.sh64
3 files changed, 143 insertions, 0 deletions
diff --git a/kate/scripts/Makefile.am b/kate/scripts/Makefile.am
new file mode 100644
index 0000000..5648dab
--- /dev/null
+++ b/kate/scripts/Makefile.am
@@ -0,0 +1,2 @@
+katescriptsdir = $(kde_datadir)/kate/scripts
+katescripts_DATA = html-tidy.desktop html-tidy.sh
diff --git a/kate/scripts/html-tidy.desktop b/kate/scripts/html-tidy.desktop
new file mode 100644
index 0000000..68a5c9e
--- /dev/null
+++ b/kate/scripts/html-tidy.desktop
@@ -0,0 +1,77 @@
+[Desktop Entry]
+Name=HTML Tidy
+Name[cs]=Úklid HTML
+Name[cy]=Tacluso HTML (HTML Tidy)
+Name[eo]=HTML-purigilo
+Name[es]=Ordenado de HTML
+Name[fa]=Tidy زنگام
+Name[hi]=एचटीएमएल टाइडी
+Name[hr]=HTML preuređivanje
+Name[ka]=HTML გაწმენდა
+Name[nds]=HTML-Tidy
+Name[ne]=एचटीएमएल स्पष्टता
+Name[pl]=Sprawdzenie poprawności HTML
+Name[sk]=Vyčistenie HTML
+Name[sv]=HTML-tidy
+Name[ta]=HTML சுத்தமாக்கம்
+Name[tr]=HTML Düzenleme
+Name[vi]=Làm sạch HTML
+Comment=Validates the current document via HTML Tidy
+Comment[ar]=التأكد من صالحية وثيقة HTML الحالية عن طريق HTML Tidy
+Comment[bg]=Валидиране на текущия документ чрез HTML Tidy
+Comment[bs]=Provjerava trenutni dokument sa HTML Tidy
+Comment[ca]=Valida el document actual mitjançant HTML Tidy
+Comment[cs]=Validuje současný dokument pomocí HTML Tidy
+Comment[cy]=Dilysa'r ddogfen gyfredol drwy ddefnyddio Tacluso HTML (HTML Tidy)
+Comment[da]=Godkender dette dokument via HTML Tidy
+Comment[de]=Überprüft das aktuelle Dokument mit "HTML Tidy"
+Comment[el]=Ελέγχει την εγκυρότητα στο τρέχον έγγραφο μέσω του HTML Tidy
+Comment[eo]=Kontrolas la nunan dokumenton laŭ HTML-purigilo
+Comment[es]=Valida que el documento HTML actual presente un orden correcto
+Comment[et]=Kontrollib aktiivset dokumenti HTML Tidy abil
+Comment[eu]=Uneko dokumentua HTML Tidy bidez balidatzen du
+Comment[fa]=سند جاری را از طریق Tidy زنگام اعتبارسنجی می‌کند
+Comment[fi]=Validoi nykyisen asiakirjan HTML Tidyllä
+Comment[fr]=Valide le document courant grâce à HTML Tidy
+Comment[fy]=Falidearret it besteande dokumint fia HTML Tidy
+Comment[ga]=Bailíochtaigh an cháipéis reatha le HTML Tidy
+Comment[gl]=Valida o documento actual utilizando HTML Tidy
+Comment[he]=מוודא את המסמך הנוכחי באמצעות HTML Tidy
+Comment[hi]=एचटीएमएल टाइडी के द्वारा मौज़ूदा दस्तावेज़ वेलिडेट करता है
+Comment[hr]=Provjera valjanosti trenutnog dokumenta putem aplikacije HTML Tidy
+Comment[hu]=Az aktuális dokumentum ellenőrzése a HTML Tidy programmal
+Comment[is]=Staðfestir núverandi skjal með HTML Tidy
+Comment[it]=Convalida il documento attuale tramite HTML Tidy
+Comment[ja]=HTML Tidy で現在のドキュメントを検証します
+Comment[ka]=მიმდინარე დოკუმენტს HTML-ს გაწმენდით ამოწმებს
+Comment[kk]=Назардағы құжатты HTML Tidy дегенге сәйкестігін тексереді
+Comment[km]=ធ្វើ​ឯកសារ​បច្ចុប្បន្ន​​មាន​សុពល​ភាព​តាមរយៈ HTML Tidy
+Comment[lt]=Patikrina dabartinį dokumentą panaudojant HTML Tidy
+Comment[mk]=Го проверува тековниот документ со HTML Tidy
+Comment[ms]=Mengesahkan dokumen semasa melalui HTML Tidy
+Comment[nb]=Validerer gjeldende dokument via HTML Tidy
+Comment[nds]=Pröövt dat aktuelle Dokment mit HTML Tidy
+Comment[ne]=एचटीएमएल स्पष्टताबाट हालको कागजात प्रमाणित गर्छ
+Comment[nl]=Valideert het huidige document via HTML Tidy
+Comment[nn]=Validerer dokumentet med HTML Tidy
+Comment[pl]=Sprawdza poprawność kodu HTML aktualnego dokumentu za pomocą HTML Tidy
+Comment[pt]=Valida o documento actual utilizando o HTML Tidy
+Comment[pt_BR]=Valida o documento atual via HTML Tidy
+Comment[ro]=Validează documentul HTML curent folosind utilitarul Tidy
+Comment[ru]=Проверяет соответствие текущей HTML-страницы на соответствие стандартам
+Comment[sk]=Skontroluje aktuálny dokument pomocou HTML Tidy
+Comment[sl]=Potrdi trenuten dokument preko HTML Tidy
+Comment[sr]=Проверава текући документ HTML Tidy-јем
+Comment[sr@Latn]=Proverava tekući dokument HTML Tidy-jem
+Comment[sv]=Validerar aktuellt dokument via HTML-tidy
+Comment[ta]=HTML டைடி மூலமாக நடப்பு ஆவணத்தை மதிப்பிடுகிறது
+Comment[tg]=Саҳифаҳои HTML -ро бо мувофиқати ҷараён дар стандарти мувофиқат, тафтиш мекунад
+Comment[tr]=HTML Tidy yardımıyla
+Comment[uk]=Перевіряє відповідність даного документа стандартам за допомогою HTML Tidy
+Comment[uz]=Ushbu hujjatni HTML-andozasiga mosligini tekshirish
+Comment[uz@cyrillic]=Ушбу ҳужжатни HTML-андозасига мослигини текшириш
+Comment[vi]=Thẩm tra tài liệu hiện thời bằng Làm sạch HTML
+Comment[zh_CN]=通过 HTML Tidy 校验当前文档
+Comment[zh_TW]=透過 HTML Tidy 驗證目前的文件
+Type=ShellScript/bash
+X-KDE-ScriptName=html-tidy.sh
diff --git a/kate/scripts/html-tidy.sh b/kate/scripts/html-tidy.sh
new file mode 100644
index 0000000..02f9282
--- /dev/null
+++ b/kate/scripts/html-tidy.sh
@@ -0,0 +1,64 @@
+#!/bin/bash
+
+# Kate script interface to html tidy
+# Version 1 - 13/10/03
+# by David Ross http://www.rossy.co.uk
+# modified by Christoph Cullmann for Kate 2.2 (KDE 3.2)
+# Version 1.1 - 15/10/03
+# Added a help message if tidy isn't installed.
+
+################
+# Start Config #
+################
+
+# Path to tidy - just use "tidy" if it is in your path
+tidy="tidy"
+
+# Specify any options you want to pass to tidy
+tidyoptions="-iu --wrap 0 --doctype transitional"
+
+# File to write errors to
+errfile=/tmp/$$.err
+infile=/tmp/$$.in
+outfile=/tmp/$$.out
+
+# Clean up when done or when aborting.
+trap "rm -f $outfile; rm -f $infile; rm -f $errfile" 0 1 2 3 15
+
+# Do you want a prompt before showing errors
+# If you don't have "kdialog" set to 0
+errprompt=1
+
+##############
+# Start Code #
+##############
+
+# Is tidy installed
+if [ `$tidy -v | grep -c "HTML Tidy"` -ne 1 ];then
+kdialog --msgbox "HTML Tidy could not be found.
+Please download install HTML tidy into your path, tidy can be downloaded from http://tidy.sf.net"
+else
+# Get the active document number
+doc=`dcop $1 KateDocumentManager activeDocumentNumber`
+
+# Get the current html from kate
+dcop $1 EditInterface#$doc text > $infile
+
+# Run the html through tidy
+cat $infile | $tidy $tidyoptions > $outfile 2> $errfile
+
+# Only send back the tidied version if there is valid html
+if [ `cat $outfile|grep -c "DOCTYPE"` -gt 0 ];then
+dcop $1 EditInterface#$doc setText "`cat $outfile`"
+fi
+
+# Open a new document with the error code should errors arise
+if [ `cat $errfile|grep -c "No warnings or errors were found"` -eq 0 ];then
+if [ $errprompt -eq 1 ];then
+kdialog --yesno "Errors were found. Do you want to see them?"
+fi
+if [ $? -eq 0 ] || [ $errprompt -eq 0 ];then
+dcop $1 KateDocumentManager openURL "$errfile" ""
+fi
+fi
+fi