[wordpress插件] CSV to htmlCSV到html

wordpress 插件 文章 2020-04-06 10:20 417 0 全屏看文

AI助手支持GPT4.0

评分
100
描述

CSV to html makes it easy to fetch content from csv-file(s) and put content from that file/those files and display the html(table) on a page with a single shortcode.

将CSV转换为html可以很容易地从csv文件中获取内容,并从该文件/这些文件中放置内容,并以单个短代码在页面上显示html(表)。

If you created files to use with the Visualizer Plugin, those are formatted in a specific way and if you have saved the csv-file(s) from excel, the csv looks

如果您创建了与Visualizer插件一起使用的文件,则这些文件将以特定的方式进行格式化,并且如果您已保存了excel中的csv文件,则csv看起来会

different.

不同。

CSV to html handles both these types and it’s fairly easy to extend the plugin to use other mechanisms to identify a specific type of format of the csv-file(s).

CSV到html可以处理这两种类型,并且很容易扩展插件以使用其他机制来识别csv文件的特定格式。

If using more then one file, content from all files are mixed into one single table – rather then creating two tables.

如果使用多个文件,则将所有文件中的内容混合到一个表中-而不是创建两个表。

It’s possible to fetch information from csv files from webservers upload folder (or a subfolder to the uploadsfolder) or

可以从网络服务器的上载文件夹(或上载文件夹的子文件夹)中的csv文件中获取信息,或者

from an external source (domain).

来自外部来源(域)。

If you like the plugin, please consider donating.

如果您喜欢该插件,请考虑捐赠。

Example of usage

用法示例

shortcodes in post(s)/page(s)

帖子/页面中的简码

    • [csvtohtml_create source_type=”visualizer_plugin” path=”lan” source_files=”skane.csv;smaland.csv;lappland.csv”]
    • [csvtohtml_create source_type =” visualizer_plugin” path =” lan” source_files =” skane.csv; smaland.csv; lappland.csv”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1.csv;excel2.csv”]
    • [csvtohtml_create source_type =“ guess” path =“ excelfolder” source_files =“ excel1.csv; excel2.csv”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”*.csv”]
    • [csvtohtml_create source_type =”猜测” path =” excelfolder” source_files =” *。csv”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2″ debug_mode=”yes”]
    • [csvtohtml_create source_type =“ guess” path =“ excelfolder” source_files =“ excel1; excel2” debug_mode =“ yes”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1.csv;excel2.csv” debug_mode=”yes” fetch_lastheaders=”3″]
    • [csvtohtml_create source_type =” guess” path =” excelfolder” source_files =” excel1.csv; excel2.csv” debug_mode =”是” fetch_lastheaders =” 3”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” debug_mode=”yes”]
    • [csvtohtml_create source_type =“ guess” path =“ excelfolder” source_files =“ excel1; excel2; http://wibergsweb.se/map/sweden.csv” debug_mode =“ yes”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” include_cols=”5,6,7,12-14″ eol_detection

    • [csvtohtml_create source_type =“ guess” path =“ excelfolder” source_files =“ excel1; excel2; http://wibergsweb.se/map/sweden.csv” include_cols =“ 5,6,7,12-14” eol_detection

      =”auto” debug_mode=”yes”]

    • =“自动” debug_mode =“是”]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” exclude_cols=”3″ debug_mode=”yes” eol_detection=”CR

    • [csvtohtml_create source_type =“ guess” path =“ excelfolder” source_files =“ excel1; excel2; http://wibergsweb.se/map/sweden.csv” exclude_cols =“ 3” debug_mode =“ yes” eol_detection =“ CR

      /LF”]

    • / LF”]

    • [csvtohtml_create html_class=”tablesorter” source_type=”guess” path=”excelfolder” source_files=”excel1;excel2;http://wibergsweb.se/map/sweden.csv” exclude_cols=”3,7,9,

    • [csvtohtml_create html_class =“ tablesorter” source_type =“ guess” path =“ excelfolder” source_files =“ excel1; excel2; http://wibergsweb.se/map/sweden.csv” exclude_cols =“ 3,7,9,

      11-13″]

    • 11-13“]

    • [csvtohtml_create source_type=”guess” path=”excelfolder” source_files=”whatever.csv” csv_delimiter=”;”]
    • [csvtohtml_create source_type =” guess” path =” excelfolder” source_files =” whatever.csv” csv_delimiter =”;”]

    • [csvtohtml_create source_type=”guess” source_files=”http://wibergsweb.se/map/sweden.csv” debug_mode=”no” convert_encoding_from=”Windows-1252″ convert_encoding_to=”UTF-8″]

    • [csvtohtml_create source_type =” guess” source_files =” http://wibergsweb.se/map/sweden.csv” debug_mode =“否” convert_encoding_from =“ Windows-1252” convert_encoding_to =“ UTF-8”]

      >

      >

    • [csvtohtml_create source_type=”guess” source_files=”http://wibergsweb.se/map/sweden.csv” debug_mode=”no” convert_encoding_to=”UTF-8″]
    • [csvtohtml_create source_type =” guess” source_files =” http://wibergsweb.se/map/sweden.csv” debug_mode =“否” convert_encoding_to =“ UTF-8”]

    • [csvtohtml_create source_type=”guess” source_files=”http://wibergsweb.se/map/sweden.csv” debug_mode=”no” sort_cols=”1,2″ sort_cols_order=”desc,asc”]

    • [csvtohtml_create source_type =” guess” source_files =” http://wibergsweb.se/map/sweden.csv” debug_mode =“否” sort_cols =“ 1,2” sort_cols_order =“ desc,asc”]

      >

      >

    Example css

    示例CSS

安装步骤

This section describes how to install the plugin and get it working.

本节介绍如何安装插件并使其正常工作。

    1. Upload the plugin folder csvtohtml to the `/wp-content/plugins/’ directory, or install the plugin through the WordPress plugins screen directly.
    2. 将插件文件夹csvtohtml上载到`/ wp-content / plugins /目录,或直接通过WordPress插件屏幕安装插件。

    3. Activate the plugin through the ‘Plugins’ screen in WordPress
    4. 通过WordPress中的“插件”屏幕激活插件

    5. Put shortcode on the WordPress post or page you want to display it on and add css to change layout for those.
    6. 在您要显示的WordPress帖子或页面上放置简码,并添加CSS来更改其布局。

    Shortcodes

    简码

      • [csvtohtml_create] – Create the html table from specified csv-file(s)
      • [csvtohtml_create] –从指定的csv文件创建html表

      [csvtohtml_create] attributes

      [csvtohtml_create]属性

        • title – set title that is shown as text in top left corner of html table (else nothing is shown there)
        • title –设置标题,该标题在html表的左上角显示为文本(否则未显示任何内容)

        • html_id – set id of this table
        • html_id –设置此表的ID

        • html_class – set class of this table (besides default csvtohtml – class)
        • html_class –设置此表的类(默认csvtohtml –类除外)

        • path – relative path to uploads-folder of the wordpress – installation ( eg. /wp-content/uploads/{path} )
        • path – WordPress上载文件夹的相对路径–安装(例如/ wp-content / uploads / {path})

        • source_type – what type to use for identifying content in csv-files (valid types are guess and visualizer_plugin).
        • source_type –用于标识csv文件中内容的类型(有效类型是guess和visualizer_plugin)。

        • fetch_lastheaders – Number of specific headers to retrieve (from end)
        • fetch_lastheaders –要检索的特定标头的数量(从末尾开始)

        • source_files – file(s) to include.

        • source_files –要包含的文件。

          If using more than one file – separate them with a semicolon (;).

          如果使用多个文件,请用分号(;)分隔。

          It ‘s (from v1.0.2) possible to include a full url instead of a filename to fetch external csv files.

          (从v1.0.2起)可以包含完整的url而不是文件名来提取外部csv文件。

          It’s also possible (v1.1.36) to fetch files from a given path (with for example *.csv).

          也可以(v1.1.36)从给定路径(例如* .csv)中获取文件。

        • csv_delimiter – what delimiter to use in each line of csv (comma, semicolon etc)
        • csv_delimiter –在csv的每一行(逗号,分号等)中使用什么定界符

        • exclude_cols – What columns to exclude in final html table (1,2,3,10-15 would exclude columns 1,2,3,10,11,12,13,14 and 15).

        • exclude_cols –最终html表中要排除的列(1,2,3,10-15会排除1,2,3,10,11,12,13,14和15列)。

          If you want to remove the last column, then simply type last instead of entering a number.

        • 如果要删除最后一列,则只需键入last而不是输入数字。

        • include_cols – What columns to include in final html table (1,2,3,10-15 would display column 1,2,3,10,11,12,13,14 and 15).

        • include_cols –最终html表中将包括哪些列(1,2,3,10-15将显示列1,2,3,10,11,12,13,14和15)。

          If include_cols is given, then exclude_cols is ignored.

        • 如果指定了include_cols,则将忽略exclude_cols。

        • eol_detection – CR = Carriage return, LF = Line feed, CR/LF = Carriage line and line feed, auto = autodetect.

        • eol_detection – CR =回车,LF =换行,CR / LF =换行和换行,auto =自动检测。

          Only useful on external files.

          仅对外部文件有用。

          Other files are automatically autodeteced.

        • 其他文件将自动检测。

        • convert_encoding_from – When converting character encoding, define what current characterencoding that csv file has.

        • convert_encoding_from –转换字符编码时,请定义csv文件当前具有的字符编码。

          (Not required, but gives best result)

        • (不是必需的,但可以提供最佳结果)

        • convert_encoding_to – When converting character encoding, define what characterencoding that csv should be encoded to.

        • convert_encoding_to –转换字符编码时,定义应将csv编码为什么字符编码。

          (Best result of encoding is when you define both encoding from and encoding both)

        • (最好的编码结果是当您同时定义编码和两者都编码时)

        • sort_cols – Which column(s) to sort on in format nr,nr och nr-nr (example 1,2,4 or 1-2,4)
        • sort_cols –以nr,nr或nr-nr格式(例如1,2,4或1-2,4)对哪一列进行排序

        • sort_cols_order – Which order to sort columns on (asc/desc).

        • sort_cols_order –对列进行排序的顺序(asc / desc)。

          If you have 3 columns, you can define these with different sorting like asc,desc,asc

        • 如果您有3列,则可以使用不同的排序方式(例如asc,desc,asc )来定义这些列

        • add_ext_auto – Add fileextension .csv to file (if it’s not specified in the source_files).

        • add_ext_auto –将文件扩展名.csv添加到文件(如果未在source_files中指定)。

          Set to no if you don’t file extension to be added automatically.

        • 如果您不希望自动添加文件扩展名,请设置为no。

        • debug_mode – if set to yes then header-values and row-values would be output to screen and files like “file not found” will be displayed (otherwise it would be “silent errors”)
        • debug_mode –如果设置为yes,则将在屏幕上输出标头值和行值,并显示“找不到文件”之类的文件(否则将是“无提示的错误”)

        Default values

        默认值

          • [csvtohtml_create title=”{none}” html_id=”{none}” html_class=”{none}” source_type=”visualizer_plugin” path=”{none}” fetch_lastheaders=”0″ source_files=”{none}”

          • [csvtohtml_create title =” {none}” html_id =” {none}” html_class =” {none}” source_type =” visualizer_plugin” path =” {none}” fetch_lastheaders =” 0” source_files =” {none}”

            csv_delimiter=”,” exclude_cols=”{none} include_cols=”{none}” eol_detection=”cr/lf” convert_encoding_from=”{none}” convert_encoding_to=”{to}” sort_cols=”{none}” sort_cols_order=”asc

            csv_delimiter =”,” exclude_cols =” {none} include_cols =” {none}” eol_detection =” cr / lf” convert_encoding_from =” {none}” convert_encoding_to =” {to}” sort_cols =” {none}” sort_cols_order =” asc

            ” add_ext_auto=”yes” debug_mode=”no”]

          • ” add_ext_auto =“是” debug_mode =“否”]

下载地址
https://downloads.wordpress.org/plugin/csv-to-html.zip
-EOF-

AI助手支持GPT4.0